For the method
[NSThread detachNewThreadSelector:@selector(method:) toTarget:self withObject:(id)SELECTOR];
How do I pass in a @selector? I tried casting it to (id) to make it compile but it crashes in runtime.
More specifically, I have a method like this
+(void)method1:(SEL)selector{
[NSThread detachNewThreadSelector:@selector(method2:) toTarget:self withObject:selector];
}
it crashes, how do I pass in the selector without crashing? So that the new thread can call the selector when the thread is ready?