我使用了 Apple 的“iOS 相机编程主题”指南中的一些代码,如下所示:
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
// Displays a control that allows the user to only take picture:
cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeImage, nil];
// Hides the controls for moving & scaling pictures, or for trimming movies. To instead show the controls, use YES.
cameraUI.allowsEditing = NO;
cameraUI.delegate = delegate;
[controller presentModalViewController: cameraUI animated: YES];
[cameraUI release];
但是,当我“分析”我的代码时,Xcode 说我有可能从以下行泄漏:
cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeImage, nil];
release
除了上面显示的命令外,我没有其他命令。鉴于有问题的数组是 cameraUI 的一个属性(已发布),我不确定我应该做什么(如果有的话)。
有什么想法吗?