我很高兴找到一个可以选择多个图像的图像选择器!但是我有一些问题要安装。对不起,我是 XCode 的初学者,所以我可能会问一些简单的问题。
我遵循此处描述的程序:http: //www.icodeblog.com/2011/03/03/update-elcimagepickercontroller/
所以在 StitchController.h
#import "ELCImagePickerController.h"
@interface StitchController : UIViewController<UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIScrollViewDelegate, ELCImagePickerControllerDelegate>
在 StitchController.m 中启动 ELCImagePicker
-(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];
}
但是现在,当我单击按钮启动时,什么都没有出现。
如果我把它改回
[app.viewController presentModalViewController:elcPicker animated:YES];
引发错误:*由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[AppDelegate viewController]:无法识别的选择器已发送到实例 0x664990”