iOS 8.3 中 UITabBarViewController 作为 UISplitViewController 的主人的问题
Issue with UITabBarViewController as master of UISplitViewController in iOS 8.3
对于我正在进行的项目,我在 iPad 模拟器中的通用应用程序 运行 中将 UITabBarViewController 作为 UISplitViewController 的主控,它曾经在 iOS 7.1 和 iOS 8.2 但使用 iOS 8.3 它崩溃并显示消息:
无法加载捆绑包中的 NIB:'NSBundle (loaded)' 名称为 'Z6l-Hd-h3H-view-7sH-l5-cWr''
请注意,如果您将模拟器更改为 7.1 或 8.2 版本之一,它可以正常工作,我不知道我做错了什么或可能导致此行为的原因。
举个例子:https://github.com/AresDev/splitwithtabbar
感谢您的帮助。
这是堆栈跟踪:
*** First throw call stack:
(
0 CoreFoundation 0x02004746 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x004eea97 objc_exception_throw + 44
2 CoreFoundation 0x0200466d +[NSException raise:format:] + 141
3 UIKit 0x00a76e2f -[UINib instantiateWithOwner:options:] + 1003
4 UIKit 0x00891124 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
5 UIKit 0x008918bb -[UIViewController loadView] + 295
6 UIKit 0x00891aef -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x00892095 -[UIViewController view] + 35
8 UIKit 0x008e1d2f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 426
9 UIKit 0x008e136f -[UITabBarController transitionFromViewController:toViewController:] + 64
10 UIKit 0x008dd52b -[UITabBarController _setSelectedViewController:] + 339
11 UIKit 0x008dd2e5 -[UITabBarController setSelectedIndex:] + 115
12 UIKit 0x008dce91 __51-[UITabBarController _setViewControllers:animated:]_block_invoke394 + 43
13 UIKit 0x007b6d4f +[UIView(Animation) performWithoutAnimation:] + 82
14 UIKit 0x008dcd3d -[UITabBarController _setViewControllers:animated:] + 3627
15 UIKit 0x008db403 -[UITabBarController _updateLayoutForTraitCollection:] + 302
16 UIKit 0x008dae73 __80-[UITabBarController willTransitionToTraitCollection:withTransitionCoordinator:]_block_invoke + 69
17 UIKit 0x00c36107 -[_UIViewControllerNullAnimationTransitionCoordinator _applyBlocks:releaseBlocks:] + 198
18 UIKit 0x00c35d9a -[_UIViewControllerNullAnimationTransitionCoordinator _runAlongsideAnimations] + 148
19 UIKit 0x008af063 -[UIViewController(UIContainerViewControllerProtectedMethods) setOverrideTraitCollection:forChildViewController:] + 399
20 UIKit 0x00c1fa10 -[UISplitViewController _setMasterOverrideTraitCollectionActive:] + 127
21 UIKit 0x00c1b35a -[UISplitViewController initWithCoder:] + 112
22 UIKit 0x00bfa92e UINibDecoderDecodeObjectForValue + 739
23 UIKit 0x00bfa643 -[UINibDecoder decodeObjectForKey:] + 371
24 UIKit 0x00a77c1a -[UIRuntimeConnection initWithCoder:] + 189
25 UIKit 0x00bfa92e UINibDecoderDecodeObjectForValue + 739
26 UIKit 0x00bfab30 UINibDecoderDecodeObjectForValue + 1253
27 UIKit 0x00bfa643 -[UINibDecoder decodeObjectForKey:] + 371
28 UIKit 0x00a76ed0 -[UINib instantiateWithOwner:options:] + 1164
29 UIKit 0x00d34185 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
30 UIKit 0x00d34301 -[UIStoryboard instantiateInitialViewController] + 74
31 UIKit 0x0072c6fc -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
32 UIKit 0x0072c984 -[UIApplication _loadMainInterfaceFile] + 245
33 UIKit 0x0072b2f4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337
34 UIKit 0x0074493e __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
35 UIKit 0x0072a04a -[UIApplication workspaceDidEndTransaction:] + 155
36 FrontBoardServices 0x031c7c9e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
37 FrontBoardServices 0x031c772f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
38 FrontBoardServices 0x031d9d7c __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 30
39 CoreFoundation 0x01f26050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
40 CoreFoundation 0x01f1b963 __CFRunLoopDoBlocks + 195
41 CoreFoundation 0x01f1b7bb __CFRunLoopRun + 2715
42 CoreFoundation 0x01f1aa5b CFRunLoopRunSpecific + 443
43 CoreFoundation 0x01f1a88b CFRunLoopRunInMode + 123
44 UIKit 0x00729a02 -[UIApplication _run] + 571
45 UIKit 0x0072d106 UIApplicationMain + 1526
46 splitwithtabbar 0x0000beba main + 138
47 libdyld.dylib 0x02bf1ac9 start + 1
48 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
将 UITabBarController 的项目 viewcontroller 设置为 UINavigationController 而不是 UIViewController
可以直接将UISplitviewController的MasterController设置为UITabBarController
最好把UISplitviewController的DetailController设置成UINavigationController
见附图
对于我正在进行的项目,我在 iPad 模拟器中的通用应用程序 运行 中将 UITabBarViewController 作为 UISplitViewController 的主控,它曾经在 iOS 7.1 和 iOS 8.2 但使用 iOS 8.3 它崩溃并显示消息:
无法加载捆绑包中的 NIB:'NSBundle (loaded)' 名称为 'Z6l-Hd-h3H-view-7sH-l5-cWr''
请注意,如果您将模拟器更改为 7.1 或 8.2 版本之一,它可以正常工作,我不知道我做错了什么或可能导致此行为的原因。
举个例子:https://github.com/AresDev/splitwithtabbar
感谢您的帮助。
这是堆栈跟踪:
*** First throw call stack:
(
0 CoreFoundation 0x02004746 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x004eea97 objc_exception_throw + 44
2 CoreFoundation 0x0200466d +[NSException raise:format:] + 141
3 UIKit 0x00a76e2f -[UINib instantiateWithOwner:options:] + 1003
4 UIKit 0x00891124 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
5 UIKit 0x008918bb -[UIViewController loadView] + 295
6 UIKit 0x00891aef -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x00892095 -[UIViewController view] + 35
8 UIKit 0x008e1d2f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 426
9 UIKit 0x008e136f -[UITabBarController transitionFromViewController:toViewController:] + 64
10 UIKit 0x008dd52b -[UITabBarController _setSelectedViewController:] + 339
11 UIKit 0x008dd2e5 -[UITabBarController setSelectedIndex:] + 115
12 UIKit 0x008dce91 __51-[UITabBarController _setViewControllers:animated:]_block_invoke394 + 43
13 UIKit 0x007b6d4f +[UIView(Animation) performWithoutAnimation:] + 82
14 UIKit 0x008dcd3d -[UITabBarController _setViewControllers:animated:] + 3627
15 UIKit 0x008db403 -[UITabBarController _updateLayoutForTraitCollection:] + 302
16 UIKit 0x008dae73 __80-[UITabBarController willTransitionToTraitCollection:withTransitionCoordinator:]_block_invoke + 69
17 UIKit 0x00c36107 -[_UIViewControllerNullAnimationTransitionCoordinator _applyBlocks:releaseBlocks:] + 198
18 UIKit 0x00c35d9a -[_UIViewControllerNullAnimationTransitionCoordinator _runAlongsideAnimations] + 148
19 UIKit 0x008af063 -[UIViewController(UIContainerViewControllerProtectedMethods) setOverrideTraitCollection:forChildViewController:] + 399
20 UIKit 0x00c1fa10 -[UISplitViewController _setMasterOverrideTraitCollectionActive:] + 127
21 UIKit 0x00c1b35a -[UISplitViewController initWithCoder:] + 112
22 UIKit 0x00bfa92e UINibDecoderDecodeObjectForValue + 739
23 UIKit 0x00bfa643 -[UINibDecoder decodeObjectForKey:] + 371
24 UIKit 0x00a77c1a -[UIRuntimeConnection initWithCoder:] + 189
25 UIKit 0x00bfa92e UINibDecoderDecodeObjectForValue + 739
26 UIKit 0x00bfab30 UINibDecoderDecodeObjectForValue + 1253
27 UIKit 0x00bfa643 -[UINibDecoder decodeObjectForKey:] + 371
28 UIKit 0x00a76ed0 -[UINib instantiateWithOwner:options:] + 1164
29 UIKit 0x00d34185 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
30 UIKit 0x00d34301 -[UIStoryboard instantiateInitialViewController] + 74
31 UIKit 0x0072c6fc -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
32 UIKit 0x0072c984 -[UIApplication _loadMainInterfaceFile] + 245
33 UIKit 0x0072b2f4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337
34 UIKit 0x0074493e __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
35 UIKit 0x0072a04a -[UIApplication workspaceDidEndTransaction:] + 155
36 FrontBoardServices 0x031c7c9e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
37 FrontBoardServices 0x031c772f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
38 FrontBoardServices 0x031d9d7c __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 30
39 CoreFoundation 0x01f26050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
40 CoreFoundation 0x01f1b963 __CFRunLoopDoBlocks + 195
41 CoreFoundation 0x01f1b7bb __CFRunLoopRun + 2715
42 CoreFoundation 0x01f1aa5b CFRunLoopRunSpecific + 443
43 CoreFoundation 0x01f1a88b CFRunLoopRunInMode + 123
44 UIKit 0x00729a02 -[UIApplication _run] + 571
45 UIKit 0x0072d106 UIApplicationMain + 1526
46 splitwithtabbar 0x0000beba main + 138
47 libdyld.dylib 0x02bf1ac9 start + 1
48 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
将 UITabBarController 的项目 viewcontroller 设置为 UINavigationController 而不是 UIViewController
可以直接将UISplitviewController的MasterController设置为UITabBarController
最好把UISplitviewController的DetailController设置成UINavigationController
见附图