【发布时间】:2011-11-07 04:13:24
【问题描述】:
是否可以使用通知与 IOS 应用程序的主线程进行通信? (参见 performSelectorOnMainThread)。也就是说,有没有为此目的的问题?
背景
- 想要从后台线程回调主 UI 线程(例如 performSelectorInBackground)
- 可以使用 performSelectorOnMainThread 进行通信,但想知道是否可以使用通知?
例如
[[NSNotificationCenter defaultCenter] postNotificationName:@"ModelChanged" object:self];
【问题讨论】:
标签: iphone ios nsthread nsnotifications nsnotificationcenter