私は現在、iPhoneとiPadの両方のiOSアプリケーションを開発しています。私はNavigationControllerを表示して、ファイルを表示するモジュールを作成しようとしています。iPhoneでは問題なく動作しますが、iPadでは動作しません。
次のエラーが発生します:
'Storyboard (<UIStoryboard: 0x919b200>) doesn't contain a view controller with identifier 'FilesNavigation''
これがコードです:
case 10: // Files
{
UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"FilesNavigation"];
FilesViewController *filesViewController = [storyboard instantiateViewControllerWithIdentifier:@"Files"];
[navigationController pushViewController:filesViewController animated:YES];
self.slidingViewController.topViewController = navigationController;
break;
}
ストーリーボードでは、ナビゲーションコントローラーのストーリーボードIDをすでに設定しています。
>##Custom Class
>Class: UINavigationController
>##Identity
>Storyboard ID: FilesNavigation
このコードを他のモジュールのスイッチ/ケースブロックの別のケースに使用しましたが、iPadでも機能します。このエラーが発生するのは初めてです。
私はそれを理解しました、問題はストーリーボードがデバイスで更新されていなかったことでした。
この質問の@ T0m_Twtの回答で述べられているように
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加