iPhone SDK - Changing Xib files (partial curl) - iphone

I am creating an iPhone app for iOS 4 using the newest SDK.
On one of my pages I would like the user to click a thumbnail of a photo and then a partial curl transition style take affect to show a full sized version of the image.
On the page with the full sized image I have a toolbar with a "Back" button and a "Select" button.
When I click the Back button the partial curls rolls back down to my first Xib.
BUT when I click the Select button, the app crashes.
Can anyone help me or explain why it is doing this? Thanks!
.m file:
-(IBAction)switchViews4 {
ImagePicker *image = [[ImagePicker alloc] initWithNibName:nil bundle:nil];
image.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:image animated:YES];
[image release];
}

Without seeing any other code, it is difficult to know why. But one guess is that you have a reference counting problem. Try:
-(IBAction)switchViews4 {
ImagePicker *image = [[[ImagePicker alloc] initWithNibName:nil bundle:nil] autorelease];
image.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:image animated:YES];
}
and see if it helps.

Related

how to disable choose button for video in UIImagePickerController

I am using UIImagePickerController to show the user which all videos he has in his Photos App.
However, I have no functionality to provide if the user clicks on Choose button, that comes up with the Cancel and play button on clicking on video thumbnail.
This is how I implement my picker:
UIImagePickerController *videoPickerCtrl = [[UIImagePickerController alloc] init];
videoPickerCtrl.delegate = self;
videoPickerCtrl.editing = NO;
videoPickerCtrl.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
NSArray *mediaTypesAllowed = [NSArray arrayWithObject:#"public.movie"];
[videoPickerCtrl setMediaTypes:mediaTypesAllowed];
[self.navigationController presentModalViewController:videoPickerCtrl animated:YES];
How can I totally remove/hide the Choose button? or can I just disable it, so that the user does not click on it?
I think, it is not possible to disable that choose button. Because that is an inbuilt
functionality of UIImagePickerController and you can not make changes in the same.

FGallery does not begin in thumbnail view

What am I doing wrong? FGallery is not starting in thumbnail view?
FotosGalleryViewController *vc = [[FotosGalleryViewController alloc] initWithPhotoSource:self];
vc.beginsInThumbnailView = YES;
[self.navigationController pushViewController:vc animated:YES];
When I turn showThumbnailViewWithAnimation:BOOL into a public method and call:
[self showThumbnailViewWithAnimation:YES];
within the FGalleryViewController it works. But it only loads the first two images in thumbnail view, the rest stays gray. Clicking Close and See all again fixes this and everything works as promised?

Install ELCImagePickerController

I feel delighted to find a image picker that can select multiple images! But I have some problems to install. Sorry for being a beginner to XCode so I may ask some simple questions.
I am following the procedures described here: http://www.icodeblog.com/2011/03/03/update-elcimagepickercontroller/
So in the StitchController.h
#import "ELCImagePickerController.h"
#interface StitchController : UIViewController<UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIScrollViewDelegate, ELCImagePickerControllerDelegate>
To launch the ELCImagePicker in StitchController.m
-(IBAction)launchController
{
ELCAlbumPickerController *albumController = [[ELCAlbumPickerController alloc] initWithNibName:#"ELCAlbumPickerController" bundle:[NSBundle mainBundle]];
ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:albumController];
[albumController setParent:elcPicker];
[elcPicker setDelegate:self];
ELCImagePickerDemoAppDelegate *app = (ELCImagePickerDemoAppDelegate *)[[UIApplication sharedApplication] delegate];
//I change app.viewController to self since I am adding the image picker over the current view?
//[app.viewController presentModalViewController:elcPicker animated:YES];
[self presentModalViewController:elcPicker animated:YES];
[elcPicker release];
[albumController release];
}
But right now, when I click the button to launch, nothing appears.
If I change it back to
[app.viewController presentModalViewController:elcPicker animated:YES];
An error is thrown: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate viewController]: unrecognized selector sent to instance 0x664990'
I'm not an storyboard or interface builder expert, in fact, i avoid them, but I would take a look at my buttons in IB or SB and make sure that they are working properly. Basically, I'm directing you away from the ELCImagePickerController as the location of the problem.
Hope this helps.
ELCAlbumPickerController *albumController = [[ELCAlbumPickerController alloc] init];
ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:albumController];
[albumController setParent:elcPicker];
[elcPicker setDelegate:self];
[self presentModalViewController:elcPicker animated:YES];
I experienced this issue when my buttons were not linked properly. Make sure you have your button linked to the "-(IBAction)launchController" IB Action. If you are not using the story board then you should have a .xib file. Click on that. If you are using the story board, navigate to the story board view. Once you viewing your xib/storyboard select the orange "Files Owner" button. After clicking on Files Owner, look on the right side and open the "connections inspector", scroll down under "Received Actions" and find "launchController" action that you created. Link that with the button you created by clicking and dragging. This will show a drop down menu, select "Touch Up Inside". Try to run the app again.

Adding an Image to tableview when clicked the More button

In the iPod application in my iphone, i see a more button in the tabbar controller. When i click it i see the other tabs that are not shown in the tababrcontroller.
I need to know how to add an image in front of the name in the tableview that appears as a result of clicking the More button.
Here's an image that will show you what exactly i want to achieve
2.) How to add an image to a button, finally it should appear in the format [image][text]
Do it like this for each View Controller that you'll be adding to your Tab Bar:
viewTab1controller = [[ViewTab1Controller alloc] initWithNibName:#"ViewTab1" bundle:nil];
viewTab1controller.title = #"Title";
navigationTab1Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab1controller] autorelease];
navigationTab1Controller.tabBarItem.image = [[UIImage imageNamed:#"icon.png"] autorelease];
[viewTab1controller release];
If you do it for each "tab" it should work for the other icons.
you can use the following
cell.imageView.image = [[UIImage alloc] initWithData: data];
Where cell is the UITableViewCell

EGOPhotoViewer: Start at specific photo

I am using EGOPhotoViewer to load up a bunch of images from the web. They are shown in thumbnails first, so when a user clicks on one of the thumbs, I want to show that image in the EGOPhotoViewer first. So, if I clicked the 5th image, it would load the image viewer starting at 5 of 20 or whatever.
Is there a way to do this?
ZSPhoto *photo;
for (Asset *a in items) {
photo = [[ZSPhoto alloc] initWithImageURL:[NSURL URLWithString:a.imgURL] name:a.caption];
[photos addObject:photo];
[photo release];
}
// Photosource
ZSPhotoSource *photoSource = [[ZSPhotoSource alloc] initWithPhotos:[NSArray arrayWithArray:photos]];
EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:photoSource];
// Set starting photo index here?
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:photoController];
navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
navController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:navController animated:YES];
[navController release];
[photoController release];
I was running into the same problem, What I was doing was trying to moveToPhotoAtIndex: before pushing it to the navigationController. You need to do it after.
here is how i got it to work for my application...
// gets indexPath from tableView
-(void)showSelectedPhoto:(NSIndexPath *)indexPath{
// Already had photoControllerView declared in header, init with your photo source
photoControllerView = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
// pushed the photoControllerView to the navigation controller
[self.navigationController pushViewController:photoController animated:YES];
// THEN you moveToPhotoAtIndex and it should work correctly!
[photoController moveToPhotoAtIndex:indexPath.row animated:NO];
}
Hope this helps clarify things!
There is a method moveToPhotoAtIndex:animated: that you should be able to use.
i am using same process to load the images in image viewer. and app is working fine for me..you can get the code from here
selected image wouldnt load in ego image viewer in ios 7
hope you will get help.