正如标题所暗示的,如果我设置选取器没有返回任何图像,如果allowsEditing = NO
imagePickerController.allowsEditing = YES;
到
imagePickerController.allowsEditing = NO
我没有得到任何图像回来了?我已搜查SO,并不能找到一个明确的答案
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = NO;
[self.editController presentModalViewController:imagePicker animated:YES];
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
DebugLog(@"info dict: %@", info);
[picker dismissModalViewControllerAnimated:YES];
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
self.schemeLogo.backgroundColor = [UIColor whiteColor];
self.schemeLogo.image = image;
NSData *imageData1 = UIImagePNGRepresentation(image);
NSString *path1 = [ICUtils pathForDocument:@"schemeLogo.png"];
[imageData1 writeToFile:path1 atomically:NO];
}
你会得到即使allowsEditing设置为NO的图像。你的(void)imagePickerController在哪里:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info? – 2013-04-29 11:33:42
啊,修好了!感谢您指向我 - (无效)imagePickerController:(UIImagePickerController *)选择器didFinishPickingMediaWithInfo:(NSDictionary *)信息{ – JSA986 2013-04-29 11:47:48