Warning: UIKit should not be called from a secondary thread

前端 未结 5 1523
悲哀的现实
悲哀的现实 2020-12-10 00:44

In my iPhone app I need to connect to a web server as this can take some time I\'m using threads like this:

[NSThread detachNewThreadSelector:@selector(sendS         


        
5条回答
  •  情书的邮戳
    2020-12-10 01:11

    [self performSelectorOnMainThread:@selector(myMethod) withObject:nil waitUntilDone:NO]; 
    

    will work

提交回复
热议问题