IOS 通知
2013-10-17 23:07
337 查看
1.注册通知
//通知
向通知中心注册了一条名为ChangeTextNotification的通知。
[[NSNotificationCenter
defaultCenter] addObserver:self
selector:@selector(changeTextContent:)
name:@"ChangeTextNotification"
object:nil];
2.发送通知
//利用通知调用更改text的方法
[[NSNotificationCenter
defaultCenter] postNotificationName:@"ChangeTextNotification"
object:_textField.text];
3.通知所执行的方法
//利用通知执行方法
- (void)changeTextContentByNotification:(NSNotification *)notification
{
id text = notification.object;
_helloField.text = text;
}
//通知
向通知中心注册了一条名为ChangeTextNotification的通知。
[[NSNotificationCenter
defaultCenter] addObserver:self
selector:@selector(changeTextContent:)
name:@"ChangeTextNotification"
object:nil];
2.发送通知
//利用通知调用更改text的方法
[[NSNotificationCenter
defaultCenter] postNotificationName:@"ChangeTextNotification"
object:_textField.text];
3.通知所执行的方法
//利用通知执行方法
- (void)changeTextContentByNotification:(NSNotification *)notification
{
id text = notification.object;
_helloField.text = text;
}
相关文章推荐
- 【转】iOS推送通知的证书设置
- ios本地通知
- iOS如何准确获取通知
- iOS中的crash防护(四)NSNotificationCenter指定线程接收通知
- iOS开发之判断用户是否打开APP通知开关
- iOS 推送通知”详解:从创建到设置到运行
- iOS通知
- iOS监听模式系列之通知中心
- iOS 之通知
- iOS通知(一)
- iOS开发:推送通知简述及开发实践
- iOS 推送通知的样式总结
- IOS AppStore审核中、上架的通知
- iOS通知传值的使用
- IOS中MVC模式和回调通知
- iOS怎么判断用户是否打开了系统设置里面推送通知的开关?
- IOS: iPhone键盘通知与键盘定制
- ios app推送通知详细教程 四 实战问题解决
- iOS 推送通知
- ios开发-推送通知