2

これはUIImagePickerControlleriOS 5 の問題のようです。

xcode4.3 を開発したアプリを持っています。2 つの iPhone (iOS 4.3 と 5.1) でテストしました。

{

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
            imagePicker.delegate = self;
            imagePicker.view.tag = tag;
            imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
            if ( imagePicker.view.tag == 1) 
            { //Editing doent allowed for biz card
                  imagePicker.allowsEditing = YES;
                  [Flurry logEvent:@"Edit Contacts:Attempt to add an image for the Contact picture using the camera"];
            }
            else {
                  [Flurry logEvent:@"Edit Contacts:Attempt to add an image for the Business Card picture using the camera"];
            }
            [self presentModalViewController:imagePicker animated:YES];
            [imagePicker release];

}

デバイスが iOS 4.1 の場合

写真を撮ったり、ライブラリから選択したりしても、リークやメモリ警告は発生しません (iOS 4.1 を実行しているデバイスでテスト済み)。

iOS 5.1 を実行しているデバイスで同じコードをテストしました。カメラ キャプチャから写真を撮影すると、定期的にメモリ警告レベル 1 に直面しました。

え..? &この問題を解決する方法..?

4

1 に答える 1

2

これを試して確認してください:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
   [picker dismissModalViewControllerAnimated:YES];
}

このメソッドを追加して確認してください。

また、そのように追加して確認します:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
            imagePicker.delegate = self;
            imagePicker.view.tag = tag;
            imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
            if ( imagePicker.view.tag == 1) 
            { //Editing doent allowed for biz card
                  imagePicker.allowsEditing = YES;
                  [Flurry logEvent:@"Edit Contacts:Attempt to add an image for the Contact picture using the camera"];
            }
            else {
                  [Flurry logEvent:@"Edit Contacts:Attempt to add an image for the Business Card picture using the camera"];
            }
            [self presentViewController:imagePicker animated:YES completion:nil];
于 2012-12-24T09:57:31.160 に答える