2016-06-27 2 views
0

시뮬레이터의 설정으로 다시 전환하면 Xcode에 오류가 표시됩니다. 누군가 제게 친절하게 알려 주시기 바랍니다. . "이 응용 프로그램은 엔진 부패와 이상한 충돌로 이어질 수있는 백그라운드 스레드에서 자동 레이아웃 엔진을 수정하는 것입니다이는 원인이됩니다시뮬레이터에서 내 앱을 실행해도 시뮬레이터 설정과 위치 서비스 모두에서 내 앱이 표시되지 않습니다

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 링크를 참조하십시오. 해결책을 찾을 수 있습니다.