0

アプリをIOS7に更新しましたが、非常に奇妙な問題が発生しています。
アプリを起動すると、本来の動作を開始し、3 ~ 5 分後にアプリの動作が停止します。
しかし、完全ではありません。通知の送信、場所の追跡などを停止します。
何らかのアクションを実行しようとすると、コンソールに次のように表示されます。

*** First throw call stack:
(
    0   CoreFoundation                      0x0305f5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0276e8b6 objc_exception_throw + 44
    2   CoreFoundation                      0x0305f3bb +[NSException raise:format:] + 139
    3   UIKit                               0x0157465c -[UINib instantiateWithOwner:options:] + 951
    4   UIKit                               0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
    5   UIKit                               0x013e743d -[UIViewController loadView] + 302
    6   UIKit                               0x013e773e -[UIViewController loadViewIfRequired] + 78
    7   UIKit                               0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
    8   UIKit                               0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
    9   UIKit                               0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
    10  UIKit                               0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
    11  UIKit                               0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
    12  UIKit                               0x0154839d -[UILayoutContainerView layoutSubviews] + 213
    13  UIKit                               0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
    14  UIKit                               0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    15  libobjc.A.dylib                     0x0278081f -[NSObject performSelector:withObject:] + 70
    16  QuartzCore                          0x00ef972a -[CALayer layoutSublayers] + 148
    17  QuartzCore                          0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    18  QuartzCore                          0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    19  QuartzCore                          0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    20  QuartzCore                          0x00e564e1 _ZN2CA11Transaction6commitEv + 393
    21  QuartzCore                          0x00f12870 +[CATransaction flush] + 52
    22  UIKit                               0x012f0979 _afterCACommitHandler + 131
    23  CoreFoundation                      0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    24  CoreFoundation                      0x0302748f __CFRunLoopDoObservers + 399
    25  CoreFoundation                      0x030053b4 __CFRunLoopRun + 1076
    26  CoreFoundation                      0x03004b33 CFRunLoopRunSpecific + 467
    27  CoreFoundation                      0x0300494b CFRunLoopRunInMode + 123
    28  GraphicsServices                    0x03ce89d7 GSEventRunModal + 192
    29  GraphicsServices                    0x03ce87fe GSEventRun + 104
    30  UIKit                               0x012d494b UIApplicationMain + 1225
    31  MyApp                           0x0000759d main + 141
    32  libdyld.dylib                       0x02c53725 start + 0
    33  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException


これは何ですか?
アプリは IOS6 で正常に動作します。

4

2 に答える 2

1

Xcode で、すべての例外で停止する例外ブレークポイントを作成します。次に、その例外が発生したときにデバッガーが停止します。入っているようです

[UINib instantiateWithOwner:options:]

しかし、あなたがそれを呼んでいるのか、それともシステムを呼んでいるのかはわかりません。

関連する問題については、こちらを参照してください: キャッチされない例外 'NSUnknownKeyException' によるアプリの終了

于 2013-10-25T12:38:22.860 に答える
1

念のため、実際の電話でこれをテストする必要があります。
ビュー内のラベルを X 秒ごとに更新するコードがあります。
IOS7までは正常に動作します。IOS7 では、3 分後にアプリがクラッシュし、質問からエラーが発生します。
ビューでラベルを更新するたびに、データを取得するために sqlite への新しい接続が開かれました。
IOS7 ではエラーが発生したため、データ アクセス クラスのインスタンスを 1 つ作成し、viewDidLoad() でのみ初期化したところ、正常に動作するようになりました。
テスト後に自分が正しいことを確認したら、間違いなくデータ アクセス クラスのシングルトン パターンを作成します。

于 2013-10-25T14:41:57.490 に答える