在我的应用程序(Ipad)中调用这段代码后,我立即得到了 EXC_BAD_ACCESS
我几乎没有从 XCode 中得到任何调试信息,XCode 向我指出了那行代码:
int retVal = UIApplicationMain(argc, argv, nil, nil);
我猜一个对象已经过早地自动释放,但是为什么以及如何解决这个问题?
NSLog(@"OpenPhotoDialog");
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = srcType;
UIDevice* thisDevice = [UIDevice currentDevice];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker] ;
popover.delegate = self;
[popover presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];