私は本当にこれを理解することはできません。リンクをクリックしてアプリ内から Safari を開き、Web ページを参照してからアプリに戻るとtabBarItems
、UITabBar
. しかし、1つを選択しようとatIndex: 0
するEXEC_BAD_ACCESS
と、次のようになります:(.これが起こらないようにする方法を理解するのを手伝ってくれる人はいますか?現在、will
ordidEnterBackground
またはで実行されるコードはありませForeground
ん。問題UIViewController
は最初のタブにあるに違いありません (サブビューを追加する理由がわかりません。関連していますか?)。
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x0109ba63 objc_msgSend + 23
1 UIKit 0x0031f3df -[UIView(Internal) _didMoveFromWindow:toWindow:] + 966
2 UIKit 0x0031f1b0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407
3 UIKit 0x0031f1b0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407
4 UIKit 0x0031f1b0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407
5 UIKit 0x0031f1b0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407
6 UIKit 0x0031f1b0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407
7 UIKit 0x0031dfc4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 166
8 UIKit 0x00316dfc -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080
9 UIKit 0x0031514f -[UIView(Hierarchy) addSubview:] + 57
10 UIKit 0x003725ac -[UITransitionView transition:fromView:toView:] + 563
11 UIKit 0x00371955 -[UITransitionView transition:toView:] + 129
12 UIKit 0x003a6383 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 459
13 UIKit 0x003a4d86 -[UITabBarController transitionFromViewController:toViewController:] + 64
14 UIKit 0x003a6b7e -[UITabBarController _setSelectedViewController:] + 263
15 UIKit 0x003a69ed -[UITabBarController _tabBarItemClicked:] + 352`