postNotificationName是个同步调用
2015-03-27 20:22
113 查看
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self initData]; [self initView]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reload) name:@"reload" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"reload" object:nil]; NSLog(@"post 1"); } static int i = 0; -(void)reload{ NSLog(@"call reloadData"); [_contactsTableView reloadData]; if(0 == i){ ++i; [[NSNotificationCenter defaultCenter] postNotificationName:@"reload" object:nil]; NSLog(@"post 2"); } }上面代码输出如下:2015-03-24 13:44:43.099 MyContacts[2380:155259] call reloadData2015-03-24 13:44:43.099 MyContacts[2380:155259] call reloadData2015-03-24 13:44:43.099 MyContacts[2380:155259] post 22015-03-24 13:44:43.100 MyContacts[2380:155259] post 1
相关文章推荐
- NSNotificationCenter postNotificationName同步阻塞调用
- postNotificationName同步调用导致的白屏问题
- iphone 消息处理事件 postNotificationName和addObserver的调用
- iphone 消息处理事件 postNotificationName和addObserver的调用
- iOS: NSNotificationCenter的方法postNotificationName:object:userInfo:
- postNotificationName 消息传递详解
- postNotificationName 消息传递详解
- postNotificationName 消息传递
- postNotificationName
- iOS: NSNotificationCenter的方法postNotificationName:object:
- post的NameValuePair[] nvp调用方法输出System.out........
- IOS学习 postNotificationName 消息传递详解
- 自定义Volley添加请求头、发送Post请求、Volley的同步和异步、getParams 不被调用
- [转]解决PowerDesigner中Name与Code同步的问题。
- 指针运算符重载实现前调用及后调用(pre and post function calls)
- 一个可同步调用异步执行的HttpWebRequest类
- vb调用winInet API接口post数据到指定的url
- .Net下采用GET/POST/SOAP方式动态调用WebService的简易灵活方法(C#)
- [Visual Basic]vb调用winInet API接口post数据到指定的url
- 异步调用 WebService 及 同步模式下通过Session以共享计数