【发布时间】:2023-03-28 15:08:01
【问题描述】:
我向您保证,我确实在 SO 中为我的问题寻找了答案,但它们都没有帮助。在这里,我得到了一个简单的代码,它应该在 UIPopoverController 中显示 UIImagePickerController:
-(void)takePicture:(id)sender{
UIImagePickerController *picker=[[UIImagePickerController alloc] init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypeCamera;
picker.allowsEditing=YES;
UIPopoverController *poc=[[UIPopoverController alloc]
initWithContentViewController:picker];
[poc presentPopoverFromBarButtonItem:bbItem
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:NO];
}
现在,即使从我第一次得到[UIPopoveController dealloc] 到达 while... 错误并且程序崩溃。我没有按照 ARC 进行任何保留、释放或自动释放。从 ARC 中受益时,UIPopoverControllers 是否有任何特殊考虑?
【问题讨论】:
标签: ios memory-management uipopovercontroller automatic-ref-counting