我有一个NSOperation.完成后,我启动NSNotificationCenter让程序知道NS操作已完成并更新gui.
据我所知,NSNotification的监听器不会在主线程上运行,因为NSOperation不在主线程上.
当我触发事件时,如何才能使侦听器在主线程上运行?
[[NSNotificationCenter defaultCenter] postNotificationName:@"myEventName" object:self];
Run Code Online (Sandbox Code Playgroud)