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