void _UIPerformResizeOfTextViewForTextContainer中的断言失败 [英] Assertion failure in void _UIPerformResizeOfTextViewForTextContainer

查看:170
本文介绍了void _UIPerformResizeOfTextViewForTextContainer中的断言失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从BOX导入文件。我用过box sdk V2。它已成功导入,但在导入时,屏幕必须在下一个控制器上导航。我正在崩溃这个

I am importing a file from BOX. I have used box sdk V2. It's importing successfully but as it imports the screen has to navigate on a next controller. I am having crash on this

NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"CategoryOptionView"
                                                      owner:nil
                                                    options:nil];

这是错误


void中的断言失败
_UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *,UIView *,NSTextContainer *,NSUInteger)(),
/SourceCache/UIFoundation_Sim/UIFoundation-229/UIFoundation/TextSystem/NSLayoutManager_Private.m :1516
2013-11-22 08:04:10.083 PunchList [1019:6a2b] ***由于未捕获的异常'NSInternalInconsistencyException'而终止app,原因:
'只在主线程上运行!'

Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation_Sim/UIFoundation-229/UIFoundation/TextSystem/NSLayoutManager_Private.m:1516 2013-11-22 08:04:10.083 PunchList[1019:6a2b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only run on the main thread!'


推荐答案

嗯,异常原因解决了问题;你应该在主线程上运行此代码。尝试使用 dispatch_sync dispatch_async 封闭视图创建和nib加载,并使用传递主队列dispatch_get_main_queue()

Well, the exception reason gives the problem away; you should run this code on the main thread. Try enclosing the view creation and nib loading using dispatch_sync or dispatch_async and passing the main queue using dispatch_get_main_queue().

这篇关于void _UIPerformResizeOfTextViewForTextContainer中的断言失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆