私は本当にここで助けが必要です。私はこの時点で絶望的です。NSOperationQueue内のNSOperationが実行されていません
NSOperationQueueに追加されたときにトリガされないNSOperationがあります。 私は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
コードは非常に簡単です。特にない。
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]);
NSLog(@"Operation isConcurrent? = %d",[operation isConcurrent]);
NSLog(@"Operation isFinished? = %d",[operation isFinished]);
NSLog(@"Operation isExecuted? = %d",[operation isExecuting]);
NSLog(@"Operation isReady? = %d",[operation isReady]);
NSLog(@"Operation dependencies? = %d",[[operation dependencies] count]);
[operation release];
私の操作では、メインメソッドで多くのことが行われますが、問題は決して呼び出されません。メインは決して実行されません。 最も奇妙なこと(私を信じて、私はまだ狂っていない..)。 NSLogの行にブレークポイントを設定するか、操作の作成時にmainメソッドが呼び出され、すべてが完全に機能します。
これは長い間うまくいきました。私は最近いくつかの変更を加えています。これらの変更の1つは、デバイスをiOS 5.1 SDK(iPad)にアップグレードすることでした。
何かを追加するには、同じNSOperationオブジェクトを使用するこのアプリケーションのiPhone(iOS 5.1)バージョンがあります。違いはUIのみであり、すべて正常に動作します。
ああ、これは実際のデバイスでのみ失敗します。シミュレータでは、すべて正常に動作します。
本当にありがとうございます。
よろしく、
それは啓発的なデバッグセッションであったに違いありません。私のために、そうだった。 –
だから、毎回睡眠をする必要がありますか?理解できません –