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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With