zoukankan      html  css  js  c++  java
  • APP崩溃提示:This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.

    崩溃输出日志
    2017-08-29 14:53:47.332368+0800 HuiDaiKe[2373:1135604] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
     Stack:(
    	0   CoreFoundation                      0x0000000188e42ff8 <redacted> + 148
    	1   libobjc.A.dylib                     0x00000001878a4538 objc_exception_throw + 56
    	2   CoreFoundation                      0x0000000188e42f28 <redacted> + 0
    	3   Foundation                          0x0000000189a35378 <redacted> + 128
    	4   Foundation                          0x000000018987da38 <redacted> + 36
    	5   UIKit                               0x000000018ef703b0 <redacted> + 816
    	6   UIKit                               0x000000018ef7c2ac <redacted> + 1740
    	7   UIKit                               0x000000018f2a57f0 <redacted> + 88
    	8   UIKit                               0x000000018efd9b04 <redacted> + 376
    	9   UIKit                               0x000000018f049840 <redacted> + 232
    	10  UIKit                               0x000000018f0495b8 <redacted> + 244
    	11  UIKit                               0x000000018f0543cc <redacted> + 932
    	12  UIKit                               0x000000018f053eec <redacted> + 184
    	13  UIKit                               0x000000018f053914 <redacted> + 1728
    	14  MJRefresh                           0x00000001013c72bc -[UITableView(MJRefresh) mj_reloadData] + 40
    	15  HuiDaiKe                            0x000000010013e440 _TFC8HuiDaiKe40CustomersAddressBookImportViewControllerP33_17FF30CE5B34E964041849EE3753856C13setDataSourcefGSaCS_19cwsAddressBookModel_T_ + 2728
    	16  HuiDaiKe                            0x000000010013d968 _TFFC8HuiDaiKe40CustomersAddressBookImportViewControllerP33_17FF30CE5B34E964041849EE3753856C11prepareDataFT_T_U_FTOCS_14cwsAddressBook4typeGSaCS_19cwsAddressBookModel__T_ + 992
    	17  HuiDaiKe                            0x00000001001c9cc0 _TFFC8HuiDaiKe14cwsAddressBook3getFT4backFTOS0_4typeGSaCS_19cwsAddressBookModel__T__T_U_FTS1_GSaS2___T_ + 252
    	18  HuiDaiKe                            0x00000001001ca5c8 _TFFFC8HuiDaiKe14cwsAddressBookP33_FC9266F7BF731B8D62B76C7FA41D90D413check_iOS_9_0FT4backFTOS0_4typeGSaCS_19cwsAddressBookModel__T__T_U0_FTSbGSqPs5Error___T_U_FTSbGSaS2___T_ + 96
    	19  HuiDaiKe                            0x00000001001caa04 _TFC8HuiDaiKe14cwsAddressBookP33_FC9266F7BF731B8D62B76C7FA41D90D411get_iOS_9_0fT4backFTSbGSaCS_19cwsAddressBookModel__T__T_ + 828
    	20  HuiDaiKe                            0x00000001001ca544 _TFFC8HuiDaiKe14cwsAddressBookP33_FC9266F7BF731B8D62B76C7FA41D90D413check_iOS_9_0FT4backFTOS0_4typeGSaCS_19cwsAddressBookModel__T__T_U0_FTSbGSqPs5Error___T_ + 220
    	21  HuiDaiKe                            0x00000001001ca6bc _TTRXFo_dSboGSqPs5Error____XFdCb_dSbdGSqCSo7NSError___ + 132
    	22  ContactsFoundation                  0x0000000191862748 <redacted> + 288
    	23  ContactsFoundation                  0x000000019186d680 <redacted> + 600
    	24  Contacts                            0x00000001918c814c <redacted> + 72
    	25  libdispatch.dylib                   0x0000000187cfa9e0 <redacted> + 24
    	26  libdispatch.dylib                   0x0000000187cfa9a0 <redacted> + 16
    	27  libdispatch.dylib                   0x0000000187d090d4 <redacted> + 644
    	28  libdispatch.dylib                   0x0000000187d0aa50 <redacted> + 540
    	29  libdispatch.dylib                   0x0000000187d0a7d0 <redacted> + 124
    	30  libsystem_pthread.dylib             0x0000000187f03100 _pthread_wqthread + 1096
    	31  libsystem_pthread.dylib             0x0000000187f02cac start_wqthread + 4
    )
    
    崩溃原因

    在子线程中更新UI导致主线程的视图布局出错

    解决方法

    把更新UI的操作放在主线程中执行

    swift示例
    DispatchQueue.main.async {
       self.mainTableview.reloadData()
    }
    
  • 相关阅读:
    在DevExpress程序中使用SplashScreenManager控件实现启动闪屏和等待信息窗口
    使用Setup Factory安装包制作工具制作安装包
    PostgreSQL介绍以及如何开发框架中使用PostgreSQL数据库
    在DevExpress中使用CameraControl控件进行摄像头图像采集
    读取数据库信息构建视图字段的备注信息,方便程序代码生成
    混合框架中Oracle数据库的还原处理操作
    使用图片视频展示插件blueimp Gallery改造网站的视频图片展示
    .NET缓存框架CacheManager在混合式开发框架中的应用(1)-CacheManager的介绍和使用
    在Winform界面菜单中实现动态增加【最近使用的文件】菜单项
    文字处理控件TX Text Control的使用
  • 原文地址:https://www.cnblogs.com/zhanbaocheng/p/7493858.html
Copyright © 2011-2022 走看看