对于方法:
[NSThread detachNewThreadSelector:@selector(method:) toTarget:self withObject:(id)SELECTOR];
我如何传入@selector?我尝试将其转换为 (id) 以使其编译,但它在运行时崩溃。
更具体地说,我有这样的方法:
+(void)method1:(SEL)selector{
[NSThread detachNewThreadSelector:@selector(method2:) toTarget:self withObject:selector];
}
它崩溃了。如何在不崩溃的情况下传入选择器,以便新线程在线程准备好时可以调用选择器?