if条件に基づいてviewDidLoadで別のモーダルView Controllerを呼び出すモーダルView Controllerがあります。
私が直面している奇妙な問題は、アプリを初めてコンパイルして最初のモーダルビューコントローラーを開くと、正常に動作し、2番目のビューコントローラーが表示されることです。ここで、アプリの実行を停止し、アプリを再構築して実行すると、最初のモーダル ビューを開くと、アプリがクラッシュします (ホーム ボタンのみが機能してフリーズします)。
これは私が得るエラーです:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function -[NSArray makeObjectsPerformSelector:] in image CoreFoundation.
2010-09-23 20:19:56.526 MySuperDuperApp[6117:207] CoreAnimation: ignoring exception: [<TwitterLogin 0x7484dc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key actionButton.
TwitterLogin は、表示に失敗した 2 番目のモーダル ビュー コントローラーの名前です。
NSLogs を入れて、クラッシュしている場所を正確に確認してみました。
//... part of the method which is called in
// viewDidAppear of first modal view controller.
- (void)login {
NSLog(@"Begin TwitterBasicVC login");
loginPopup = [[TwitterLogin alloc] init];
loginPopup.oAuth = oAuth;
loginPopup.viewDelegate = self;
loginPopup.interfaceDelegate = self;
// Show Login screen.
loginPopup.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
NSLog(@"presenting loginPopup modalView");
[self presentModalViewController:loginPopup animated:YES];
[loginPopup release];
NSLog(@"End TwitterBasicVC login");
//... viewDidLoad of second modal view controller.
- (void)viewDidLoad {
NSLog(@"Begin TwitterLogin viewDidLoad");
[super viewDidLoad];
queue = [[NSOperationQueue alloc] init];
...
「presenting loginPopup modalView」メッセージは出力されますが、「Begin TwitterLogin viewDidLoad」メッセージは出力されません。モーダル ビュー プレゼンテーションと viewDidLoad の間でクラッシュする理由がわかりません。
奇妙なことは、アプリをビルド/実行するたびにこれが発生することです。(アプリを削除してビルドしようとしましたが、それでも発生します)
編集: twitterLogin が割り当て開始されるログイン メソッドの最初の数行を追加しました。また、値 0.0 および 1.0 で performSelector:withObject:afterDelay を使用してメソッドを呼び出してみましたが、問題はまだ存在します。
編集 2: iPhone/シミュレーターにアプリをインストールしようとするたびに (デバイス/シミュレーターからアプリを削除した後)、クリーン ビルドを行いました。アプリはこの方法で正常に動作しているようです。アプリストアにアプリをアップロードしても安全だと思いますか?
デバッグをどのように進めるべきかについての提案は、私を大いに助けてくれます:)
ありがとう