メインスレッドのcancelメソッドは効かないようだ。
NSLog(@"main thread isCancelled 1:%d", [[NSThread mainThread] isCancelled]);
[[NSThread mainThread] cancel];
NSLog(@"main thread isCancelled 2:%d", [[NSThread mainThread] isCancelled]);
の結果
main thread isCancelled 1:0
main thread isCancelled 2:0
サブスレッドにて
NSLog(@"sub thread isCancelled 1:%d", [[NSThread currentThread] isCancelled]);
[[NSThread currentThread] cancel];
NSLog(@"sub thread isCancelled 2:%d", [[NSThread currentThread] isCancelled]);
の結果は、当然こうなる
sub thread isCancelled 1:0
sub thread isCancelled 2:1