I am currently learning IOS Threading programming... I encountered an issue:
Here comes my code, please kindly have a look:
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSThread *t1 = [[NSThread alloc]initWithTarget:[MyThread class] selector:@selector(myMethod:) object:Nil];
[t1 start];
}
return 0;
}
#import "MyThread.h"
@implementation MyThread
+ (void)myMethod:(id)param
{
@autoreleasepool {
NSLog(@"called...");
}
}
@end
However, when I ran my program, though there was no error, no message was printed on the console. It seems like myMethod was not executed. I wonder if anyone could give me some suggestions. It has already driven me crazy.
Many thanks in advance.