0

iTunes Connect にアプリのクラッシュ レポートがあります。アルバムにアクセスするとアプリがクラッシュするとUIImagePickerController表示されますが、シミュレーターでも実機でも問題を再現できません。以下がクラッシュレポートの内容です。問題を特定するのを手伝ってください。

Hardware Model:      iPhone4,1
Process:         eyerecolor [5011]
Path:            /var/mobile/Applications/B9D7CEA3-DB1D-4CE3-B605-90EC066B7C92/eyerecolor.app/eyerecolor
Identifier:      eyerecolor
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]


Date/Time:       2012-04-06 18:51:37.692 -0500
OS Version:      iPhone OS 5.0 (9A334)
Report Version:  104


Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0


Last Exception Backtrace:
0   CoreFoundation                 0x371198bf __exceptionPreprocess + 163

1   libobjc.A.dylib                0x324891e5 objc_exception_throw + 33

2   CoreData                       0x3728c64b -[NSPersistentStoreCoordinator setMetadata:forPersistentStore:] + 411

3   PhotoLibraryServices           0x31585ffd +[PLManagedObjectContext(Private) recordVersion:forStore:] + 393

4   PhotoLibraryServices           0x31586385 +[PLManagedObjectContext(Private) configurePersistentStoreCoordinator:] + 897

5   PhotoLibraryServices           0x3158691f __69+[PLManagedObjectContext(Protected) sharedPersistentStoreCoordinator]_block_invoke_0323 + 179

6   libdispatch.dylib              0x32a908cf _dispatch_barrier_sync_f_invoke + 27

7   libdispatch.dylib              0x32a9072f dispatch_barrier_sync_f$VARIANT$mp + 63

8   libdispatch.dylib              0x32a9034f dispatch_sync_f$VARIANT$mp + 19

9   libdispatch.dylib              0x32a909f9 dispatch_sync$VARIANT$mp + 33

10  PhotoLibraryServices           0x3158681f +[PLManagedObjectContext(Protected) sharedPersistentStoreCoordinator] + 155

11  PhotoLibraryServices           0x315853c9 -[PLManagedObjectContext initWithConcurrencyType:useSharedPersistentStoreCoordinator:] + 121

12  PhotoLibraryServices           0x315852a7 +[PLManagedObjectContext contextForPhotoLibrary:] + 115

13  PhotoLibraryServices           0x31584ec9 -[PLPhotoLibrary(Protected) loadDatabase] + 237

14  PhotoLibraryServices           0x3154d87d -[PLPhotoLibrary initWithPath:canTriggerDatabaseUpdate:] + 305

15  PhotoLibraryServices           0x315942a1 __42+[PLSharedPhotoLibrary sharedPhotoLibrary]_block_invoke_0 + 61

16  libdispatch.dylib              0x32a92683 dispatch_once_f$VARIANT$mp + 47

17  PhotoLibraryServices           0x3159425f +[PLSharedPhotoLibrary sharedPhotoLibrary] + 83

18  PhotoLibrary                   0x32c69bc9 -[PLUILibraryViewController _updateFilteredAlbumListWithFilter:] + 157

19  PhotoLibrary                   0x32c6961b -[PLUILibraryViewController init] + 67

20  UIKit                          0x31f58cc5 -[UIImagePickerController _createInitialController] + 317

21  UIKit                          0x31f58d05 -[UIImagePickerController _setupControllersForCurrentSourceType] + 25

22  UIKit                          0x31f58711 -[UIImagePickerController viewWillAppear:] + 69

23  UIKit                          0x31d336b5 -[UIViewController _setViewAppearState:isAnimating:] + 145

24  UIKit                          0x31d8e61b -[UIViewController beginAppearanceTransition:animated:] + 191

25  UIKit                          0x31dd4691 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 4077

26  UIKit                          0x31dd314f -[UIViewController presentViewController:withTransition:completion:] + 3123

27  UIKit                          0x044f2e93 -[UIViewControllerAccessibility(SafeCategory) presentViewController:animated:completion:] + 51

28  UIKit                          0x31e2dd97 -[UIViewController presentModalViewController:animated:] + 31

29  eyerecolor                     0x00009c39 -[eyerecolorViewController showImagePicker:] (eyerecolorViewController.m:1855)

- (void)showImagePicker:(UIImagePickerControllerSourceType)sourceType
{
    if ([UIImagePickerController isSourceTypeAvailable:sourceType]) {
        self.m_pickerView.sourceType = sourceType;
        self.m_pickerView.allowsEditing = NO;
        [self presentModalViewController:self.m_pickerView animated:YES];
    }
}

- (void)viewDidLoad
{
    if (self.m_pickerView == nil) {
        self.m_pickerView = [[[UIImagePickerController alloc] init] autorelease];
        self.m_pickerView.delegate = self;
        self.m_pickerView.allowsImageEditing = NO;
    }
}
4

2 に答える 2

0

これで問題が解決するかどうかはわかりませんが、お役に立てば幸いです...

コードを iOS 5 で試しましたか? そして、あなたのデバイスはどうですか?

クラッシュ レポートを見ると、問題は iPhone 4S の iOS 5 に関連しているようです。

Hardware Model: iPhone4,1
...
OS Version: iPhone OS 5.0 (9A334)

を自動解放しないようにしてくださいUIImagePickerController。自動解放されたオブジェクトは、メモリ管理をスムーズにする代わりに問題を引き起こすことがあります。

編集:もう1つ...ここでは、AppleがUIImagePickerControllerを実装することを提案しています:

  1. デバイスが目的のソースからコンテンツを選択できることを確認します。isSourceTypeAvailable: クラス メソッドを呼び出して、「UIImagePickerControllerSourceType」列挙型から定数を提供します。
  2. availableMediaTypesForSourceType: クラス メソッドを呼び出して、使用しているソース タイプに対して利用可能なメディア タイプを確認します。これにより、動画撮影に使用できるカメラと静止画のみに使用できるカメラを区別できます。
  3. mediaTypes プロパティを設定して、利用可能にするメディア タイプ (静止画像、動画、またはその両方) に従って UI を調整するようにイメージ ピッカー コントローラーに指示します。
  4. 現在アクティブなビュー コントローラーのpresentViewController:animated:completion:メソッドを呼び出してユーザー インターフェイスを 表示し、構成済みのイメージ ピッカー コントローラーを新しいビュー コントローラーとして渡します。iPad では、ポップオーバーを使用してユーザー インターフェイスを表示します。これは、イメージ ピッカー コントローラーの sourceType プロパティが UIImagePickerControllerSourceTypeCamera に設定されている場合にのみ有効です。ポップオーバー コントローラーを使用するには、UIPopoverController クラス リファレンスの「ポップオーバーの表示と非表示」で説明されているメソッドを使用します。
  5. ユーザーがボタンをタップして、新しくキャプチャまたは保存された画像またはムービーを選択するか、操作をキャンセルすると、デリゲート オブジェクトを使用して画像ピッカーを閉じます。新しくキャプチャされたメディアの場合、デリゲートはそれをデバイスのカメラ ロールに保存できます。以前に保存されたメディアの場合、デリゲートはアプリの目的に応じて画像データを使用できます。

UIImagePickerController クラスリファレンスから

編集 (再度): デバイスに問題がない場合は非常に奇妙ですが、実際の状況を変更する方法を提案します。

viewDidLoad の代わりに showImagePicker:(UIImagePickerControllerSourceType)sourceType で UIImagePicker コントローラーを実装します。

allowImageEditing (iOS 3.1 で非推奨) の代わりに allowEditing を使用し、オブジェクトを自動解放しないでください...

于 2012-04-07T18:28:07.873 に答える