码迷,mamicode.com
首页 > 其他好文 > 详细

debug"may only be called from the main thread"

时间:2015-10-13 19:01:19      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

此bug发生是因为目前的进程中有更新UI的操作但是没有在主线程中进行所引起的,

所以简单的方法是使用gcd切换主线程进行UI更新

        //UI更新需要在主线程
        dispatch_async(dispatch_get_main_queue(), ^
                       {
                           [weakLoginAnimated removeFromSuperview];

                       });

 

debug"may only be called from the main thread"

标签:

原文地址:http://www.cnblogs.com/louyizhidu/p/4875207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!