我正在使用ShareKit
iOS 应用程序的开源共享基础。有一个已知错误会阻止 Kit 检测到您的根视图控制器是什么。该错误的修复是[SHK setRootViewController:myViewController];
在应用程序委托中添加。
如果修复在UIApplication didFinishLaunching
方法中,视图控制器不就是self
吗?我错过了什么?我也试过了self.viewController
,没有用。self.window.rootViewController
self.window
编辑:这是整个didFinishLoading
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[Chatter_BoxViewController alloc] initWithNibName:@"Chatter_BoxViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
[SHK setRootViewController:self.viewController];
return YES;
}