我建立了一个single view工程,没有勾选storyboard,拖了一个按钮过去,然后编译,运行出来就出问题了,模拟器就是黑屏的
------解决方案--------------------
self.switchViewController = [[XSwitchViewController alloc] initWithNibName:@"SwitchView" bundle:nil];
UIView *switchView = self.switchViewController.view;
CGRect switchViewFrame = switchView.frame;
switchViewFrame.origin.y = [UIApplication sharedApplication].statusBarFrame.size.height;
switchView.frame = switchViewFrame;
[self.window addSubview:switchView];