I want to subclass NSOperation to make it concurrent, according to the Apple doc, I must override the following methods to implement a concurrent operation:
- start
- isExecuting
- isFinished
- isAsynchronous
But as per my test result, I can let the NSOperation object run in a second thread without implementing the "isExecuting","isFinished" and "isAsynchronous" methods.I just write the code.
[NSThread detachNewThreadSelector:@selector(main) toTarget:self withObject:nil];
in the start method and then in the main thread I execute
[myOperation start]
then the operation can execute in a second a second thread instead of main thread. Can someone explain this phe
NSOperationQueue
to run yourNSOperation
. Setup the queue to be concurrent (or serial). – rmaddy