Xcode7.2 OS X 10.11.3を使用しています。
画像の通り、iPhone標準の「設定」のようなNavigationControllerを使った深い階層まで辿れるアプリを作成しています。
ここで、各ビューにクラスを設定していない(ただパーツをstoryboardにドラッグドロップしてsegueで繋げただけ)状態でビルドすると正常に右端のビューまで遷移するのですが、
下の画像のようにそれぞれのビューにクラスを設定すると、右端まで正常に遷移せず左のビューの「次へ」ボタンを押した時点でクラッシュしてしまいます。
NavigationControllerを使った終点の遷移先のビューで、クラスを設定して動作させるためにはどのような処理をすればよいでしょうか?
また、この方法では無理ならば他にどのような代替案があるのでしょうか?
かなり分かりにくい説明ではあると思いますが、ご教授いただけたら嬉しいです。
ご不明な点があれば分かる限りお答えしますので遠慮なくご質問お願いします。
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
追記<2/17 3:07>
コメントがありましたので、階層の画像を添付します。
この画像が参考になればと思います・・・。
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
追記<2/17 15:49>
クラッシュログを追加しました。
2016-02-17 15:47:27.806 NaigationControllerTest3[10469:1571701] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported' *** First throw call stack: ( 0 CoreFoundation 0x00000001067f4e65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010475fdeb objc_exception_throw + 48 2 UIKit 0x0000000104da5f6d __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 0 3 UIKit 0x0000000104da5299 -[UINavigationController pushViewController:animated:] + 848 4 UIKit 0x00000001053725d8 __66-[UIStoryboardPushSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 1660 5 UIKit 0x00000001052eff5c -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 460 6 UIKit 0x00000001052efd5f -[UIStoryboardSegueTemplate _perform:] + 82 7 UIKit 0x00000001052f0023 -[UIStoryboardSegueTemplate perform:] + 156 8 UIKit 0x0000000104bc8194 -[UIApplication sendAction:to:from:forEvent:] + 92 9 UIKit 0x0000000104fc97b7 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 152 10 UIKit 0x0000000104bc8194 -[UIApplication sendAction:to:from:forEvent:] + 92 11 UIKit 0x0000000104d376fc -[UIControl sendAction:to:forEvent:] + 67 12 UIKit 0x0000000104d379c8 -[UIControl _sendActionsForEvents:withEvent:] + 311 13 UIKit 0x0000000104d37b43 -[UIControl _sendActionsForEvents:withEvent:] + 690 14 UIKit 0x0000000104d36af8 -[UIControl touchesEnded:withEvent:] + 601 15 UIKit 0x0000000104c3749b -[UIWindow _sendTouchesForEvent:] + 835 16 UIKit 0x0000000104c381d0 -[UIWindow sendEvent:] + 865 17 UIKit 0x0000000104be6b66 -[UIApplication sendEvent:] + 263 18 UIKit 0x0000000104bc0d97 _UIApplicationHandleEventQueue + 6844 19 CoreFoundation 0x0000000106720a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 20 CoreFoundation 0x000000010671695c __CFRunLoopDoSources0 + 556 21 CoreFoundation 0x0000000106715e13 __CFRunLoopRun + 867 22 CoreFoundation 0x0000000106715828 CFRunLoopRunSpecific + 488 23 GraphicsServices 0x00000001084e1ad2 GSEventRunModal + 161 24 UIKit 0x0000000104bc6610 UIApplicationMain + 171 25 NaigationControllerTest3 0x000000010425ebff main + 111 26 libdyld.dylib 0x000000010743c92d start + 1 27 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/02/16 18:06
2016/02/16 23:55 編集
2016/02/16 23:54
2016/02/17 07:27
2016/02/17 07:32 編集
2016/02/17 07:55
2016/02/17 08:31 編集