Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

ios - Assertion failure in void _UIPerformResizeOfTextViewForTextContainer

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];

and this is the error

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!'

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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().


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...