[iOS开发]使用GCD遇到的问题

原创 2015年11月19日 17:28:45

最近在使用GCD遇到这样的问题,刚开始不是很明白,不能使用后台线程来修改autolayout引擎?后来查了一下问题,在iOS9 - This application is modifying the autolayout engine from a background thread — where?这里找到了答案,想起之前看过一篇文章详细论述GCD的提到修改UI的操作应该放在主线程中,因为iOS的设计就是用主线程来加载渲染界面的,因此恍然大悟,感觉实践才能检验真理呀!

2015-11-19 17:14:25.825 VRPVisual[8917:2969207] 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                      0x0000000183578f60 <redacted> + 148
    1   libobjc.A.dylib                     0x00000001980c7f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000183578e90 <redacted> + 0
    3   Foundation                          0x00000001845972d8 <redacted> + 88
    4   Foundation                          0x00000001844194fc <redacted> + 36
    5   UIKit                               0x000000018936f108 <redacted> + 884
    6   UIKit                               0x000000018937057c <redacted> + 788
    7   UIKit                               0x000000018943f740 <redacted> + 480
    8   UIKit                               0x000000018943c708 <redacted> + 172
    9   UIKit                               0x000000018943c978 <redacted> + 96
    10  UIKit                               0x000000018943ce3c <redacted> + 80
    11  UIKit                               0x00000001894413d0 <redacted> + 492
    12  UIKit                               0x000000018944053c <redacted> + 148
    13  UIKit                               0x000000018944047c <redacted> + 284
    14  UIKit                               0x0000000188f70d40 <redacted> + 444
    15  UIKit                               0x0000000188f70e14 <redacted> + 60
    16  UIKit                               0x0000000188f70f54 <redacted> + 28
    17  UIKit                               0x0000000188f70504 <redacted> + 100
    18  UIKit                               0x0000000188b0c098 <redacted> + 996
    19  UIKit                               0x0000000188b0bc9c <redacted> + 28
    20  UIKit                               0x0000000188e8b184 <redacted> + 108
    21  UIKit                               0x0000000188e842d4 <redacted> + 1328
    22  UIKit                               0x0000000188e85d94 <redacted> + 4644
    23  UIKit                               0x0000000188e88800 <redacted> + 472
    24  UIKit                               0x0000000188c05ea0 <redacted> + 184
    25  UIKit                               0x000000018942e880 <redacted> + 512
    26  UIKit                               0x000000018942ce34 <redacted> + 228
    27  UIKit                               0x0000000188f8081c <redacted> + 260
    28  VRPVisual                           0x000000010002c704 __48-[ExportViewController requestToExportInstance:]_block_invoke176 + 2760
    29  VRPVisual                           0x0000000100029a94 __86-[BMKRouteSearch(BatchRouteSearch) drivingRouteMatrixSearch:successBlock:failedBlock:]_block_invoke_3 + 592
    30  libdispatch.dylib                   0x00000001007a9ca8 _dispatch_call_block_and_release + 24
    31  libdispatch.dylib                   0x00000001007a9c68 _dispatch_client_callout + 16
    32  libdispatch.dylib                   0x00000001007b8ec8 _dispatch_root_queue_drain + 2344
    33  libdispatch.dylib                   0x00000001007b8590 _dispatch_worker_thread3 + 132
    34  libsystem_pthread.dylib             0x0000000198af9470 _pthread_wqthread + 1092
    35  libsystem_pthread.dylib             0x0000000198af9020 start_wqthread + 4
)
2015-11-19 17:14:25.841 VRPVisual[8917:2969207] 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                      0x0000000183578f60 <redacted> + 148
    1   libobjc.A.dylib                     0x00000001980c7f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000183578e90 <redacted> + 0
    3   Foundation                          0x00000001845972d8 <redacted> + 88
    4   Foundation                          0x000000018441da1c <redacted> + 56
    5   Foundation                          0x00000001844195dc <redacted> + 260
    6   UIKit                               0x000000018936f108 <redacted> + 884
    7   UIKit                               0x000000018937057c <redacted> + 788
    8   UIKit                               0x000000018943f740 <redacted> + 480
    9   UIKit                               0x000000018943c708 <redacted> + 172
    10  UIKit                               0x000000018943c978 <redacted> + 96
    11  UIKit                               0x000000018943ce3c <redacted> + 80
    12  UIKit                               0x00000001894413d0 <redacted> + 492
    13  UIKit                               0x000000018944053c <redacted> + 148
    14  UIKit                               0x000000018944047c <redacted> + 284
    15  UIKit                               0x0000000188f70d40 <redacted> + 444
    16  UIKit                               0x0000000188f70e14 <redacted> + 60
    17  UIKit                               0x0000000188f70f54 <redacted> + 28
    18  UIKit                               0x0000000188f70504 <redacted> + 100
    19  UIKit                               0x0000000188b0c098 <redacted> + 996
    20  UIKit                               0x0000000188b0bc9c <redacted> + 28
    21  UIKit                               0x0000000188e8b184 <redacted> + 108
    22  UIKit                               0x0000000188e842d4 <redacted> + 1328
    23  UIKit                               0x0000000188e85d94 <redacted> + 4644
    24  UIKit                               0x0000000188e88800 <redacted> + 472
    25  UIKit                               0x0000000188c05ea0 <redacted> + 184
    26  UIKit                               0x000000018942e880 <redacted> + 512
    27  UIKit                               0x000000018942ce34 <redacted> + 228
    28  UIKit                               0x0000000188f8081c <redacted> + 260
    29  VRPVisual                           0x000000010002c704 __48-[ExportViewController requestToExportInstance:]_block_invoke176 + 2760
    30  VRPVisual                           0x0000000100029a94 __86-[BMKRouteSearch(BatchRouteSearch) drivingRouteMatrixSearch:successBlock:failedBlock:]_block_invoke_3 + 592
    31  libdispatch.dylib                   0x00000001007a9ca8 _dispatch_call_block_and_release + 24
    32  libdispatch.dylib                   0x00000001007a9c68 _dispatch_client_callout + 16
    33  libdispatch.dylib                   0x00000001007b8ec8 _dispatch_root_queue_drain + 2344
    34  libdispatch.dylib                   0x00000001007b8590 _dispatch_worker_thread3 + 132
    35  libsystem_pthread.dylib             0x0000000198af9470 _pthread_wqthread + 1092
    36  libsystem_pthread.dylib             0x0000000198af9020 start_wqthread + 4
)
2015-11-19 17:14:25.853 VRPVisual[8917:2969207] 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                      0x0000000183578f60 <redacted> + 148
    1   libobjc.A.dylib                     0x00000001980c7f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000183578e90 <redacted> + 0
    3   Foundation                          0x00000001845972d8 <redacted> + 88
    4   Foundation                          0x00000001844194fc <redacted> + 36
    5   UIKit                               0x000000018936f158 <redacted> + 964
    6   UIKit                               0x000000018937057c <redacted> + 788
    7   UIKit                               0x000000018943f740 <redacted> + 480
    8   UIKit                               0x000000018943c708 <redacted> + 172
    9   UIKit                               0x000000018943c978 <redacted> + 96
    10  UIKit                               0x000000018943ce3c <redacted> + 80
    11  UIKit                               0x00000001894413d0 <redacted> + 492
    12  UIKit                               0x000000018944053c <redacted> + 148
    13  UIKit                               0x000000018944047c <redacted> + 284
    14  UIKit                               0x0000000188f70d40 <redacted> + 444
    15  UIKit                               0x0000000188f70e14 <redacted> + 60
    16  UIKit                               0x0000000188f70f54 <redacted> + 28
    17  UIKit                               0x0000000188f70504 <redacted> + 100
    18  UIKit                               0x0000000188b0c098 <redacted> + 996
    19  UIKit                               0x0000000188b0bc9c <redacted> + 28
    20  UIKit                               0x0000000188e8b184 <redacted> + 108
    21  UIKit                               0x0000000188e842d4 <redacted> + 1328
    22  UIKit                               0x0000000188e85d94 <redacted> + 4644
    23  UIKit                               0x0000000188e88800 <redacted> + 472
    24  UIKit                               0x0000000188c05ea0 <redacted> + 184
    25  UIKit                               0x000000018942e880 <redacted> + 512
    26  UIKit                               0x000000018942ce34 <redacted> + 228
    27  UIKit                               0x0000000188f8081c <redacted> + 260
    28  VRPVisual                           0x000000010002c704 __48-[ExportViewController requestToExportInstance:]_block_invoke176 + 2760
    29  VRPVisual                           0x0000000100029a94 __86-[BMKRouteSearch(BatchRouteSearch) drivingRouteMatrixSearch:successBlock:failedBlock:]_block_invoke_3 + 592
    30  libdispatch.dylib                   0x00000001007a9ca8 _dispatch_call_block_and_release + 24
    31  libdispatch.dylib                   0x00000001007a9c68 _dispatch_client_callout + 16
    32  libdispatch.dylib                   0x00000001007b8ec8 _dispatch_root_queue_drain + 2344
    33  libdispatch.dylib                   0x00000001007b8590 _dispatch_worker_thread3 + 132
    34  libsystem_pthread.dylib             0x0000000198af9470 _pthread_wqthread + 1092
    35  libsystem_pthread.dylib             0x0000000198af9020 start_wqthread + 4
)
2015-11-19 17:14:25.863 VRPVisual[8917:2969207] 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                      0x0000000183578f60 <redacted> + 148
    1   libobjc.A.dylib                     0x00000001980c7f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000183578e90 <redacted> + 0
    3   Foundation                          0x00000001845972d8 <redacted> + 88
    4   Foundation                          0x000000018441da1c <redacted> + 56
    5   Foundation                          0x00000001844195dc <redacted> + 260
    6   UIKit                               0x000000018936f158 <redacted> + 964
    7   UIKit                               0x000000018937057c <redacted> + 788
    8   UIKit                               0x000000018943f740 <redacted> + 480
    9   UIKit                               0x000000018943c708 <redacted> + 172
    10  UIKit                               0x000000018943c978 <redacted> + 96
    11  UIKit                               0x000000018943ce3c <redacted> + 80
    12  UIKit                               0x00000001894413d0 <redacted> + 492
    13  UIKit                               0x000000018944053c <redacted> + 148
    14  UIKit                               0x000000018944047c <redacted> + 284
    15  UIKit                               0x0000000188f70d40 <redacted> + 444
    16  UIKit                               0x0000000188f70e14 <redacted> + 60
    17  UIKit                               0x0000000188f70f54 <redacted> + 28
    18  UIKit                               0x0000000188f70504 <redacted> + 100
    19  UIKit                               0x0000000188b0c098 <redacted> + 996
    20  UIKit                               0x0000000188b0bc9c <redacted> + 28
    21  UIKit                               0x0000000188e8b184 <redacted> + 108
    22  UIKit                               0x0000000188e842d4 <redacted> + 1328
    23  UIKit                               0x0000000188e85d94 <redacted> + 4644
    24  UIKit                               0x0000000188e88800 <redacted> + 472
    25  UIKit                               0x0000000188c05ea0 <redacted> + 184
    26  UIKit                               0x000000018942e880 <redacted> + 512
    27  UIKit                               0x000000018942ce34 <redacted> + 228
    28  UIKit                               0x0000000188f8081c <redacted> + 260
    29  VRPVisual                           0x000000010002c704 __48-[ExportViewController requestToExportInstance:]_block_invoke176 + 2760
    30  VRPVisual                           0x0000000100029a94 __86-[BMKRouteSearch(BatchRouteSearch) drivingRouteMatrixSearch:successBlock:failedBlock:]_block_invoke_3 + 592
    31  libdispatch.dylib                   0x00000001007a9ca8 _dispatch_call_block_and_release + 24
    32  libdispatch.dylib                   0x00000001007a9c68 _dispatch_client_callout + 16
    33  libdispatch.dylib                   0x00000001007b8ec8 _dispatch_root_queue_drain + 2344
    34  libdispatch.dylib                   0x00000001007b8590 _dispatch_worker_thread3 + 132
    35  libsystem_pthread.dylib             0x0000000198af9470 _pthread_wqthread + 1092
    36  libsystem_pthread.dylib             0x0000000198af9020 start_wqthread + 4
)
2015-11-19 17:14:25.986 VRPVisual[8917:2969022] <CATransformLayer: 0x13e113b70> - changing property masksToBounds in transform-only layer, will have no effect
2015-11-19 17:14:25.987 VRPVisual[8917:2969022] <CATransformLayer: 0x13ea49a80> - changing property masksToBounds in transform-only layer, will have no effect
2015-11-19 17:14:25.988 VRPVisual[8917:2969022] <CATransformLayer: 0x13ec251c0> - changing property masksToBounds in transform-only layer, will have no effect
2015-11-19 17:14:53.980 VRPVisual[8917:2969022] Warning: Attempt to present <MFMailComposeViewController: 0x136c4f200> on <ExportViewController: 0x13a23e960> whose view is not in the window hierarchy!
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

iOS调试Bug技巧

本文转载自唐巧大神的博客, 让XCode的 Stack Trace信息可读 让XCode的 Stack Trace信息可读 NOV 14TH, 2012 昨天在写iOS...

iOS开发:GCD的使用

GCD Grand Central Dispatch 纯C语言编写 1. GCD是苹果公司为多核的并行运算提出的解决方案  GCD会自动利用更多的CPU内核(比如双核、四核)  GCD会自动管理线...

iOS开发多线程篇—GCD的基本使用

一、主队列介绍 主队列:是和主线程相关联的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中得任务,都会放到主线程中执行。 提示:如果把任务放到主队列中进行处理,那么不论处理函数是异步的还...

[笔记]iOS开发之多线程GCD和NSOperation基本使用

在iOS开发中多线程技术常用的就是GCD和NSOperation,以下介绍这两种的基本使用. GCD:     GCD的基本概念           同步函数 sync (不管是串行队列还...
  • Yuzee
  • Yuzee
  • 2015-08-18 21:14
  • 476

iOS开发之多线程编程技术NSThread、NSOperation、GCD三者使用详解

三种方式的优缺点介绍: 1)NSThread  优点:NSThread 比其他两个轻量级  缺点:需要自己管理线程的生命周期,线程同步。线程同步对数据的加锁会有一定的系统开销  2)C...

iOS开发多线程篇—GCD的基本使用

一、主队列介绍 主队列:是和主线程相关联的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中得任务,都会放到主线程中执行。 提示:如果把任务放到主队列中进行处理,那么不论处理函数是异步的还...

IOS开发(60)之使用GCD执行UI操作

1 前言 本章作为入门,我们将介绍介绍一下,能使用GCD执行UI操作。 2 代码实例 ZYViewController.h #import @interface ZYViewCon...

iOS开发多线程—07GCD的基本使用

iOS开发多线程篇—GCD的基本使用 一、主队列介绍 主队列:是和主线程相关联的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中得任务,都会放到主线程中执行。 提示:如果把任务放到主队列中进...

iOS开发多线程-GCD的基本使用

一、主队列介绍 主队列:是和主线程相关联的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中得任务,都会放到主线程中执行。 提示:如果把任务放到主队列中进行处理,那么不论处理函数是异步的还是同...

iOS开发多线程篇—GCD的基本使用

iOS开发多线程篇—GCD的基本使用 一、主队列介绍 主队列:是和主线程相关联的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中得任务,都会放到主线程中执行。 提示:如果把...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)