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(リリースされている)の属性であるとすると、(もしあれば)何をすべきかわかりません。
何かご意見は?