【发布时间】:2012-08-14 17:34:55
【问题描述】:
当传递给@selector 的方法有参数时需要语法帮助。谢谢!
//This works
dispatch_async(kBgQueue, ^{
[self performSelectorOnMainThread:@selector(hydrateList) withObject:nil waitUntilDone:YES];
});
//But what about when the method in the selector has arguments?
//This is incorrect, syntactically
dispatch_async(kBgQueue, ^{
[self performSelectorOnMainThread:@selector(hydrateListForCategory:self.categorySelected) withObject:nil waitUntilDone:YES];
});
【问题讨论】:
-
搜索该方法并阅读文档。 NSObject documentation
标签: objective-c ios5 objective-c-blocks performselector