【发布时间】:2010-10-30 06:54:53
【问题描述】:
对于方法:
[NSThread detachNewThreadSelector:@selector(method:) toTarget:self withObject:(id)SELECTOR];
如何传入@selector?我尝试将其转换为 (id) 以使其编译,但它在运行时崩溃。
更具体地说,我有一个这样的方法:
+(void)method1:(SEL)selector{
[NSThread detachNewThreadSelector:@selector(method2:) toTarget:self withObject:selector];
}
它崩溃了。如何在不崩溃的情况下传入选择器,以便新线程在线程就绪时调用选择器?
【问题讨论】:
标签: iphone objective-c selector