0
我使用的UIImagePickerController一个小问题...我想我的实例的viewController时使用由用户选择的图像从iPhone库,并使用它:使用的UIImagePickerController检索照片库中选择图片
第一用户必须点击StartWithImage按钮:
-(IBAction)startWithImage:(UIButton *) sender
{
self.imgPicker = [[UIImagePickerController alloc] init];
self.imgPicker.delegate = self;
self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:self.imgPicker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)imagePicker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissModalViewControllerAnimated:YES];
[imagePicker release];
//UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
photo =(UIImage *) [info objectForKey:UIImagePickerControllerOriginalImage];
//code for starting game
}
这是我的我的实例的viewController:
imageSliderViewController = [[ImageSliderViewController alloc] initWithSize:colMax :rowMax:photo];
我的看法控制器使用在viewDidLoad中喜欢这张照片:
CGImageRef cgImg = CGImageCreateWithImageInRect(photo.CGImage, CGRectMake(ox, oy, width-1, height-1));//-1 for block effect
我得到一个EXC_BAD_ACCESS错误...
有没有回溯或堆栈为贵 “'EXC_BAD_ACCESS'” 错误清单? – 2012-04-23 22:57:39
我是一个巨大的初学者......我该如何检查?当Xcode – Marcouss 2012-04-23 23:18:44
崩溃时,我可能有一个输出窗口(如果你没有看到它,点击Xcode中的“View”菜单,你会看到一个“Debug”子菜单。点击下面的“激活控制台”,然后,当发生崩溃时,你会看到一个“(lldb)'”提示符。输入命令“'bt'”(不带引号),你应该看到崩溃的位置实际发生的 – 2012-04-23 23:40:17