Getting a “This application is modifying the autolayout engine from a background thread” error?

后端 未结 21 1907
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 15:52

Been encountering this error a lot in my OS X using swift:

\"This application is modifying the autolayout engine from a background thread, which can

21条回答
  •  一向
    一向 (楼主)
    2020-11-22 16:21

    For me the issue was the following. Make sure performSegueWithIdentifier: is performed on the main thread:

    dispatch_async (dispatch_get_main_queue(), ^{
      [self performSegueWithIdentifier:@"ViewController" sender:nil];
    });
    

提交回复
热议问题