我真的需要帮助.我在这一点上很绝望.
我有NSOperation,当添加到NSOperationQueue时没有被触发.我添加了一些日志记录以查看NSOperation状态,结果如下:
Queue operations count = 1
Queue isSuspended = 0
Operation isCancelled? = 0
Operation isConcurrent? = 0
Operation isFinished? = 0
Operation isExecuted? = 0
Operation isReady? = 1
Operation dependencies? = 0
Run Code Online (Sandbox Code Playgroud)
代码很简单.没什么特别的.
LoadingConflictEvents_iPad *loadingEvents = [[LoadingConflictEvents_iPad alloc] initWithNibName:@"LoadingConflictEvents_iPad" bundle:[NSBundle mainBundle]];
loadingEvents.modalPresentationStyle = UIModalPresentationFormSheet;
loadingEvents.conflictOpDelegate = self;
[self presentModalViewController:loadingEvents animated:NO];
[loadingEvents release];
ConflictEventOperation *operation = [[ConflictEventOperation alloc] initWithParameters:wiLr.formNumber pWI_ID:wiLr.wi_id];
[queue addOperation:operation];
NSLog(@"Queue operations count = %d",[queue operationCount]);
NSLog(@"Queue isSuspended = %d",[queue isSuspended]);
NSLog(@"Operation isCancelled? = %d",[operation isCancelled]); …Run Code Online (Sandbox Code Playgroud)