Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested optimization should never be triggered. This is probably due to autolayout work happening inside an NSISVariable delegate callback

App crashed and log gave me this message:

"Nested optimization should never be triggered. This is probably due to autolayout work happening inside an NSISVariable delegate callback, which is not allowed."

How to fix this?

like image 768
LucasKarlsson Avatar asked Nov 08 '22 21:11

LucasKarlsson


1 Answers

Think I was updating UI in a background thread. Try putting: if ([NSThread isMainThread]) { NSLog(@"isMainThread"); } else { NSLog(@"isNotMainThread"); } next to UI updating lines, in order to find UI updates in background thread.

Example:

if ([NSThread isMainThread]) { NSLog(@"isMainThread"); } else { NSLog(@"isNotMainThread"); }
_MyLbl.text=@"some text";

if isNotMainThread is shown in log, replace the two lines with:

dispatch_async(dispatch_get_main_queue(), ^{
   _MyLbl.text=@"some text";
});

Not really an answer, more of a tip. But better than nothing I guess.

like image 75
LucasKarlsson Avatar answered Nov 15 '22 12:11

LucasKarlsson