For the method:
[NSThread detachNewThreadSelector:@selector(method:) toTarget:self withObject:(id)SELECTOR];
How do I pass in a @selector? I tr
You can convert between selectors and string objects using the NSStringFromSelector()
and NSSelectorFromString()
functions. So you can just pass string objects instead.
Alternately, if you don't want to change your methods, you can create an NSInvocation
to create an invocation for your method call (since it can set up invocations with non-object arguments), and then to call it do [NSThread detachNewThreadSelector:@selector(invoke) toTarget:myInvocation withObject:nil];