У меня есть TTSplitViewController, в котором я пытаюсь показать UITabBarController на левой панели с помощью кода:
@implementation SplitAppController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
[self setupURLRouting];
}
return self;
}
- (void)setupURLRouting {
[self routePrimaryNavigator];
[self routeDetailsNavigator];
}
- (void)routePrimaryNavigator {
TTURLMap* map = self.primaryNavigator.URLMap;
// Forward all unhandled URL actions to the right navigator.
[map from: @"*" toObject: self selector: @selector(willOpenUrlPath:)];
[map from:@"tt://primary" toViewController:[RootViewController class]];
}
RootViewController - это UITabBarController. Однако я получаю следующую ошибку:
2011-07-08 08:04:23.739 app[3241:207] -[RootViewController topViewController]: unrecognized selector sent to instance 0x520c060
2011-07-08 08:04:23.755 app[3241:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RootViewController topViewController]: unrecognized selector sent to instance 0x520c060'
*** Call stack at first throw:
(
0 CoreFoundation 0x017d95a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0192d313 objc_exception_throw + 44
2 CoreFoundation 0x017db0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0174a966 ___forwarding___ + 966
4 CoreFoundation 0x0174a522 _CF_forwarding_prep_0 + 50
5 app 0x000f73ff -[TTSplitViewController updateSplitViewButton] + 176
6 app 0x000f75d9 -[TTSplitViewController viewDidAppear:] + 90
7 UIKit 0x00ae1fab -[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:] + 694
8 UIKit 0x00a64e4b -[UIView(Internal) _didMoveFromWindow:toWindow:] + 918
9 UIKit 0x00a63a60 -[UIView(Hierarchy) _postMovedFromSuperview:] + 166
10 UIKit 0x00a5c750 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080
11 UIKit 0x00a5aaa3 -[UIView(Hierarchy) addSubview:] + 57
12 app 0x00083d01 -[TTBaseNavigator setRootViewController:] + 306
13 app 0x000841f9 -[TTBaseNavigator presentController:parentController:mode:action:] + 70
14 app 0x00084437 -[TTBaseNavigator presentController:parentURLPath:withPattern:action:] + 359
15 app 0x00084975 -[TTBaseNavigator openURLAction:] + 1320
16 app 0x0000c440 -[appAppDelegate application:didFinishLaunchingWithOptions:] + 848
17 UIKit 0x00a2bc89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
18 UIKit 0x00a2dd88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
19 UIKit 0x00a38617 -[UIApplication handleEvent:withNewEvent:] + 1533
20 UIKit 0x00a30abf -[UIApplication sendEvent:] + 71
21 UIKit 0x00a35f2e _UIApplicationHandleEvent + 7576
22 GraphicsServices 0x01fee992 PurpleEventCallback + 1550
23 CoreFoundation 0x017ba944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
24 CoreFoundation 0x0171acf7 __CFRunLoopDoSource1 + 215
25 CoreFoundation 0x01717f83 __CFRunLoopRun + 979
26 CoreFoundation 0x01717840 CFRunLoopRunSpecific + 208
27 CoreFoundation 0x01717761 CFRunLoopRunInMode + 97
28 UIKit 0x00a2d7d2 -[UIApplication _run] + 623
29 UIKit 0x00a39c93 UIApplicationMain + 1160
30 app 0x00031342 main + 130
31 app 0x00002a75 start + 53
)
terminate called after throwing an instance of 'NSException'
Как мне это исправить?