Objective c 在目标C&;中释放UIImagePickerControl;IOS 5.1

Objective c 在目标C&;中释放UIImagePickerControl;IOS 5.1,objective-c,ipad,ios5,Objective C,Ipad,Ios5,在使用use buttom后尝试释放UIImagePickerControl时出现语法错误 - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // Access the uncropped image from info dictionary UIImage *image = [info objectForK

在使用use buttom后尝试释放UIImagePickerControl时出现语法错误

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
 // Access the uncropped image from info dictionary
 UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

    [viewsavedimage setImage: image];

 [picker release];
}

是[选择器释放];正确与否?

您不应该从imagePickerController中释放picker,因为它是一个参数。您应该从调用imagePickerController的位置释放它。 如果你使用ARC(弱,强),你不需要这样做。内存管理器会为您执行此操作