Reputation: 673
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'
Upvotes: 1
Views: 1449
Reputation: 1
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.
Upvotes: 0
Reputation: 1869
ELCAlbumPickerController *albumController = [[ELCAlbumPickerController alloc] init];
ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:albumController];
[albumController setParent:elcPicker];
[elcPicker setDelegate:self];
[self presentModalViewController:elcPicker animated:YES];
Upvotes: 0
Reputation: 205
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.
Upvotes: 1