以前は iPhone OS 3.0 の iPhone アプリで NSOperationQueue を使用していましたが、iOS 4.0 ではコードが正しく機能しません。一度だけ正しく実行され、その後のすべての呼び出しでは機能しません。iOS 4.0 の NSOperationQueue に変更はありますか?
関連するコードは次のとおりです。
- (void) starteffectFunction {
NSOperationQueue *queue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(starteffectProcessing)
object:nil];
[queue addOperation:operation];
[operation release];
[queue release];
[spinner startAnimating];
}
-(void) starteffectProcessing{
some code executes. code snippet. A
......
this code is note supposed to execute before A completes. But this executes before A.
}