如何避免XCode警告“在此块中强烈捕获'自我'可能会导致保留周期”

时间:2013-07-08 05:15:39

标签: xcode

示例代码:

 self.library = [[ALAssetsLibrary alloc] init];
        self.imageEditor = [[DemoImageEditor alloc] initWithNibName:@"DemoImageEditor" bundle:nil withSize:CGSizeMake(398, 508)];

        self.imageEditor.doneCallback = ^(UIImage *editedImage, BOOL canceled){
            if(!canceled) {
                [popoverController dismissPopoverAnimated:YES];                    photoImg.image = editedImage;
                //[UIImage imageWithCGImage:CGImageCreateWithImageInRect([editedImage CGImage], CGRectMake(0, 0, 398, 508))];
            }
            [imagePicker popToRootViewControllerAnimated:YES];
            [imagePicker setNavigationBarHidden:NO animated:YES];
        };

警告:

 [popoverController dismissPopoverAnimated:YES];capturing 'self' strongly in this block is likely to lead to a retain cycle

0 个答案:

没有答案