iam試圖從照片庫導入圖像,但當我按導入按鈕程序崩潰並收到SGIBART!但我的代碼在iPhone上工作正常嗎?iPad UIImagePicker問題!
這裏是我的代碼:
.H:
@interface CameraViewController : UIViewController <UIImagePickerControllerDelegate ,UINavigationControllerDelegate> {
UIImagePickerController *ipc;
UIImageView * image1;
@property (.......................;
}
.M:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
image1.image = [[info objectForKey:UIImagePickerControllerOriginalImage]retain];
[[picker parentViewController]dismissModalViewControllerAnimated:YES];
[picker release];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[[picker parentViewController]dismissModalViewControllerAnimated:YES];
[picker release];
}
-(IBAction) importImage1 {
ipc = [[UIImagePickerController alloc]init];
ipc.delegate = self;
ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:ipc animated:YES];
}
你表明它拋出SIGABRT,但然後說你的代碼工作正常。 「你工作得很好嗎?」是什麼意思?什麼是信號點的崩潰堆棧? – 2010-09-11 14:51:26
我的作品很好,IPHONE不IPAD – 2010-09-11 16:54:34