jjzjj

MyOperation

全部标签

ios - 取消的操作仍在运行

我需要取消操作队列中的所有操作。但在调用cancellAllOperation方法后,操作仍在运行。简单的例子:@interfaceMyOperation:NSOperation@end@implementationMyOperation-(void)main{NSLog(@"starting1");sleep(4);NSLog(@"finished1");}@end@interfaceViewController()@end@implementationViewController-(void)viewDidLoad{[superviewDidLoad];NSOperationQue