我有一个应用程序,我用Rails通过Devise管理注册/进/出.
当我登录时,我被重定向到Backbone启动的Dashboard #index.
我想以某种方式检索Backbone中的current_user.id和current_user.token.
我唯一的想法是在我的dashboard.html.haml中有这个
:javascript
window.App.current_user.id = "#{current_user.id}"
window.App.current_user.token = "#{current_user.token}"
Run Code Online (Sandbox Code Playgroud) 我使用故事板生成了一个新的选项卡式应用程序.
到目前为止我有
TabBarController - > FirstViewController - > SecondViewController - > ModalViewController
我正在尝试在显示tabBarController之前打开模态视图.我在AppDelegate.m上添加了以下代码
showModalView
被称为 application:didFinishLaunchingWithOptions:;
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
GSLoginViewController *loginView = [storyboard instantiateViewControllerWithIdentifier:@"loginView"];
[loginView setModalPresentationStyle:UIModalPresentationFullScreen];
[self.window.rootViewController presentViewController:loginView animated:YES completion:NULL];
}
Run Code Online (Sandbox Code Playgroud)
在这里输出我:
Warning: Attempt to present <ModalViewController: 0x93670d0> on
<UITabBarController: 0x935d170> whose view is not in the window hierarchy!
Run Code Online (Sandbox Code Playgroud)