2016-06-27 11 views
0

私はあなたに教えてください。おかげで、事前に私はシミュレータで私のアプリケーションを実行すると、両方のシミュレータの設定と位置情報サービスの下で私のアプリを表示しません

GeoNet[2325:41287] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release. 
Stack:(
    0 CoreFoundation      0x00c5ba14 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x0071ce02 objc_exception_throw + 50 
    2 CoreFoundation      0x00c5b93d +[NSException raise:format:] + 141 
    3 Foundation       0x004ee74b _AssertAutolayoutOnMainThreadOnly + 96 
    4 Foundation       0x003164c1 -[NSISEngine optimize] + 67 
    5 Foundation       0x00316f84 -[NSISEngine withBehaviors:performModifications:] + 245 
    6 Foundation       0x0031a404 -[NSISEngine withAutomaticOptimizationDisabled:] + 48 
    7 UIKit        0x01dd9b08 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 75 
    8 UIKit        0x01dda781 -[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 278 
    9 UIKit        0x01aa48b8 -[UITableViewCellContentView updateConstraintsIfNeeded] + 185 
    10 UIKit        0x01ddb66c -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeeded] + 372 
    11 UIKit        0x014a919a -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 173 
    12 UIKit        0x014a9929 -[UIView(Hierarchy) layoutSubviews] + 184 
    13 UIKit        0x014bb008 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 810 
    14 libobjc.A.dylib      0x00731059 -[NSObject performSelector:withObject:] + 70 
    15 QuartzCore       0x0603480a -[CALayer layoutSublayers] + 144 
    16 QuartzCore       0x060284ee _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388 
    17 QuartzCore       0x06028352 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 
    18 QuartzCore       0x0601ae8b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317 
    19 QuartzCore       0x0604ee03 _ZN2CA11Transaction6commitEv + 561 
    20 QuartzCore       0x0604f1ab _ZN2CA11Transaction14release_threadEPv + 289 
    21 libsystem_pthread.dylib    0x0308d2f7 _pthread_tsd_cleanup + 93 
    22 libsystem_pthread.dylib    0x0308d051 _pthread_exit + 108 
    23 libsystem_pthread.dylib    0x0308d734 pthread_get_stackaddr_np + 0 
    24 libsystem_pthread.dylib    0x0308ae0e start_wqthread + 30 
) 

答えて

1

これは、iOS 9以降、コードが正常に動作する以前のバージョンで発生しています。なぜなら、いくつかの関数はバックグラウンドスレッド上で実行しなければならず、ビューロード後にビューの外観を変更しようとするからです。したがって、その関数をメインスレッドに置き、非同期にロードする必要があります。より具体的な答えを読み込もうとしているViewControllerのコードを共有してください。

dispatch_async(dispatch_get_main_queue(), ^{ 
// your code here 
}) 
0

迅速使用して、私のOS Xでこのエラーをたくさん遭遇されて:「このアプリケーションは、エンジンの破損や奇妙なクラッシュにつながることができ、バックグラウンドスレッドから自動レイアウトエンジンを変更しているこれが原因となります。将来のリリースでは例外となります。

thisリンクを参照してください。解決策を見つけることができます。