首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >对于模态分割,performSegueWithIdentifier方法速度很慢

对于模态分割,performSegueWithIdentifier方法速度很慢
EN

Stack Overflow用户
提问于 2015-06-10 22:19:39
回答 1查看 461关注 0票数 0

我必须显示注册视图控制器。目前这个屏幕是用UIWindow.rootViewController方法加载的,我不喜欢它作为解决方案。

在谷歌搜索后,我发现了this问题,这对我一点帮助都没有(问题仍然存在),所以我不得不问,还有没有其他solutions.My代码如下:

代码语言:javascript
运行
复制
-(void)viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];
  if(![Class isUserRegistered]){
    [self performSegueWithIdentifier:@"" sender:self];
  }
}

注册控制器在5-7秒后显示(iPhone 4,7.1.2)

一种可能的选择是使用自适应segue-s,但目前这是不可能的。

我注意到,当我从storyboar中删除所有插座时,视图的加载速度要快得多。

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2015-06-10 22:24:31

尝尝这个,

代码语言:javascript
运行
复制
dispatch_async(dispatch_get_main_queue(), ^{
    //this block of code is executed on main thread, all UI operations should be done on main thread
    [self performSegueWithIdentifier:@"" sender:self];
});
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30759094

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档