presentViewController is so slow in "tableView:didSelectRowAtIndexPath:"

Use Case: 在UITableView的delegate方法"tableView:didSelectRowAtIndexPath:"中调用

"[UIViewController presentViewController]"发现被显示的ViewController要有很长的延迟

才会显示出来。

修改后:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSInteger rowInSection = indexPath.row;
switch (rowInSection) {
case : // age
{
dispatch_async(dispatch_get_main_queue(), ^{
NSDate * nowDate = [NSDate date];
QZDatePickerViewController * datePickerViewController = [[QZDatePickerViewController alloc] initWithDate:nowDate];
datePickerViewController.delegate = self;
[self presentViewController:datePickerViewController
animated:NO
completion:nil];
}); }
break;
}

Reference

1. presentViewController:animated:YES view will not appear until user taps again

http://stackoverflow.com/questions/21075540/presentviewcontrolleranimatedyes-view-will-not-appear-until-user-taps-again

iOS.Performance-trick-presentViewController-is-so-slow-in-didSelectRowAtIndexPath的更多相关文章

  1. iOS pushViewController 和 presentViewController的区别 详解

    pushViewController 导航控制器入栈的方式切换页面presentViewController 模态切换的方式切换页面 1:用 UINavigationController 的时候用 p ...

  2. Unity3D Optimizing Graphics Performance for iOS

    原地址:http://blog.sina.com.cn/s/blog_72b936d801013ptr.html icense Comparisons http://unity3d.com/unity ...

  3. Why mobile web apps are slow

    http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/ I’ve had an unusual number of interest ...

  4. iOS CoreAnimate

    iOS CoreAnimate 东西比较多,这篇笔记是入门用的,主要讲述的是静态的图形绘画处理问题.(当然动画也只是一小部分)理解相关的概念问题:   参考资料 http://segmentfault ...

  5. 25个增强iOS应用程序性能的提示和技巧(高级篇)(2)

    25个增强iOS应用程序性能的提示和技巧(高级篇)(2) 2013-04-16 14:56 破船之家 beyondvincent 字号:T | T 在开发iOS应用程序时,让程序具有良好的性能是非常关 ...

  6. iOS应用性能调优建议

    本文来自iOS Tutorial Team 的 Marcelo Fabri,他是Movile的一名 iOS 程序员.这是他的个人网站:http://www.marcelofabri.com/,你还可以 ...

  7. iOS应用性能调优的25个建议和技巧

    本文来自iOS Tutorial Team 的 Marcelo Fabri,他是Movile的一名 iOS 程序员.这是他的个人网站:http://www.marcelofabri.com/,你还可以 ...

  8. 25 个增强iOS应用程序性能的提示和技巧 应用程序性能的提示和技巧

    初级 在开发过程中,下面这些初级技巧需要时刻注意: 1.使用ARC进行内存管理2.在适当的情况下使用reuseIdentifier3.尽可能将View设置为不透明(Opaque)4.避免臃肿的XIBs ...

  9. 复杂TableView在iOS上的性能优化

    声明:本文翻译自<iOS performance optimization>,原文作者 Khang Vo.翻译本文纯属为了技术交流的目的,并不具有任何的商业性质,也不得利用本文内容进行商业 ...

随机推荐

  1. bashrc

    # ~/.bashrc: executed by bash(1) for non-login shells.# see /usr/share/doc/bash/examples/startup-fil ...

  2. python中的浅拷贝和深拷贝

    1.赋值语句 a = 'abc' b = a print id(a) print id(b) # id(a):29283464 # id(b):29283464 通过简单的复制,我们可以看到,a b其 ...

  3. 基于 EntityFramework 的数据库主从读写分离

    现在刚开始来研究EntityFramwork,起初是在vs2012中通过工具来创建EF ,但是对我这种不熟悉菜鸟来说 有很多业务用EF做出来还是有点难度的,今天来手动搭建一个EF框架,大神勿喷

  4. VUE 入门基础(2)

    二,起步 引用方式可以使用  vue-cli <script src="https://unpkg.com/vue/dist/vue.js"></script&g ...

  5. FTP服务器原理

    21.1 FTP服务器原理   使用明码传输方式,且有相当多的安全危机历史.因此一般使用功能较少的vsftpd这个软件.   21.1.1 FTP功能简介   有以下功能 文档传输与管理 不同等级的用 ...

  6. Ajax的封装03

    一.Ajax   1.原理:基于http协议的     内置对象:XMLHttpRequest 发起请求 那会相应     步骤: var xhr=new XMLHttpRequest(); // 请 ...

  7. sql搜索like通配符的用法详解

    http://www.lmwlove.com/ac/ID878 有很多朋友写了几年的like搜索,可能对like后面通配符的用法都不了解,甚至于%的作用是什么都不清楚.在这篇文章中,我们就一起来学习一 ...

  8. asp.net mvc return file result

    asp.net mvc返回文件: public ActionResult ExportReflection(string accessToken) { var reflections = GetCms ...

  9. vs2012中将图片放到resource中进行调用

    1.在项目中新建一个名叫resource的文件夹,然后将所需图片信息放入该文件夹,如图 2.右击该项目,选择属性->资源选项卡,步骤如图所示 点击添加现有文件,然后找到你刚刚添加的resourc ...

  10. .net Session 超时控制

    webconfig里明明设置了timeout是很大的数值了,可是session的有效性仍然无法维持一小时. 查了一下,主要是说 mode="InProc" 的话,session是放 ...