2

UIImagePickerControllerUnityアプリで使用しています。ユーザーが「完了」を押すと、時々フリーズします。これは 3GS で最も頻繁に発生しますが (約 3 回に 1 回)、iPhone 5 でも時々フリーズしました。このバグは iOS 4.3 から 7.0 で発生します。フリーズに関連する要因を特定できませんでした。このフリーズが発生しても、メモリの警告は表示されません。

ログにエラーはなく、クラッシュログもありません。アプリはUIImagePickerController通常どおり遅れて実行され続けます。コンソールには、「deny file-write-data /private/var/mobile/Media/PhotoData」など、関連していると思われるメッセージが多数ありますが、フリーズが存在する場合とすべてが機能している場合の両方で、それらすべてが時折表示されることがあります。大丈夫。

ピッカーを表示する方法は次のとおりです。

- (void)showPicker:(UIImagePickerControllerSourceType)type
{
    imgPicker = [[[CustomPhotoPicker alloc] init] autorelease];
    imgPicker.delegate = self;
    imgPicker.sourceType = type;
    imgPicker.allowsEditing = _pickerAllowsEditing;

    // wrap and show the modal
    [self showViewControllerModallyInWrapper:imgPicker];

}

デリゲート メソッドは次のとおりです。

- (void)imagePickerController:(UIImagePickerController*)imgPicker didFinishPickingMediaWithInfo:(NSDictionary*)info
{
    NSLog( @"imagePickerController didFinishPickingMediaWithInfo");

    // If the freeze is present, this method isn't called
}

- (void)imagePickerController:(UIImagePickerController *)imgPicker
        didFinishPickingImage:(UIImage *)image
                  editingInfo:(NSDictionary *)editingInfo
{
    NSLog( @"imagePickerController didFinishPickingImage");

    // Tried to use deprecated callback. If the freeze is present, this method isn't called either.
}

私はそれが 内のバグであると判断しますが、UIImagePickerControllerUnity を使用していない iOS 開発者でこの問題に遭遇したことはありません。4.3 に存在する場合、そのようなバグは既に修正されていると思います。

4

1 に答える 1

1

次のように、UnityAppController.mm で CFRunLoopRunInMode をミュートできます。

- (void)repaintDisplayLink
{
    [_displayLink setPaused: YES];
    {
        static const CFStringRef kTrackingRunLoopMode = CFStringRef(UITrackingRunLoopMode);
        if (![EtceteraManager picking])
        {
            while (CFRunLoopRunInMode(kTrackingRunLoopMode, kInputProcessingTime, TRUE) == kCFRunLoopRunHandledSource)
                ;
        }
    }
}
于 2013-10-29T09:30:42.203 に答える