我从父类调用此方法

图像选择器

- (void) imagePickerController:(UIImagePickerController *)thePicker didFinishPickingMediaWithInfo:(NSDictionary *)imageInfo
{

     UIImage *imag = [imageInfo objectForKey:@"UIImagePickerControllerOriginalImage"];
    NSData *imageData = UIImageJPEGRepresentation(imag,0.1);

    [parentviewcontroller requestToParentWithImage:imageData];
}


在这里,parentviewcontroller在imagepicker.h中声明

@property(strong,nonatomic)UIViewController<SmartretailDelegate> *parentviewcontroller;


任务清单数据

IMAG=[IMAGEPICKER alloc]init];
IMAG.parentviewcontroller=self;


我的问题是parentviewcontroller未分配。它在哪里释放/崩溃?

最佳答案

'strong'属性指示保留parentviewcontroller对象,并且在释放imagePicker对象时将其释放。有关更多信息,请参考此链接“ Objective-C ARC: strong vs retain and weak vs assign”。

关于iphone - 如何找到在iOS中释放对象的位置,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18285991/

10-10 20:40