js是单线程的,所以有些大量计算的操作会占用线程资源,导致页面卡住。今天遇到这样一个场景,选择一个下拉框之后,对数据进行筛选,这个过程中有大量计算,点了selecte的option之后,option不隐藏,一直卡在那里,直到筛选计算完成。这个体验非常差,于是想,能不能接触当前线程的占用,让交互看起来...
分类:
Web程序 时间:
2015-01-07 18:21:27
阅读次数:
283
1,NStimer 的初始化方式有下面四种,分为timerWithTimeInterval和scheduledTimerWithTimeInterval开头的1 + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti invocation:(NSI...
分类:
移动开发 时间:
2015-01-06 23:02:44
阅读次数:
185
//使用轮播图展示一组图片信息 //定时器 使循环 [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(runTimePage) userInfo:nil repeats:YES]; //初始化sc...
分类:
移动开发 时间:
2015-01-05 01:54:10
阅读次数:
218
计时器代码:_hour,_minute初始值为0;//计算时间-(void)Time{//60秒后执行@selector:方法 _timer = [NSTimer scheduledTimerWithTimeInterval:60.0f target:self selector:@selector....
分类:
其他好文 时间:
2015-01-04 14:53:31
阅读次数:
208
不同的类会有不同的传递方式,参数名也不尽相同。如果是传单个参数的就不用集合,如果是传多个参数可以用类似nsarray,nsdictionary之类的集合传递。看下面例子:例子1:通过NSTimer看IPhone对@selector的函数如何传参数,NSMutableDictionary *dict ...
分类:
移动开发 时间:
2015-01-03 14:29:20
阅读次数:
590
实现思路:1、创建一个UIScrollView,这里设置为宽度300,高度130,通过storyboard创建;2、使用代码在UIScrollView中添加ImageView,横向放入多张ImageView;3、设置UIScrollView的contentSize为所有图片的宽度总和;4、要保证UI...
分类:
其他好文 时间:
2015-01-01 06:39:44
阅读次数:
228
1. NSRunLoopCommonModes和Timer 当使用NSTimer的scheduledTimerWithTimeInterval方法时。事实上此时Timer会被加入到当前线程的Run Loop中,且模式是默认的NSDefaultRunLoopMode。而如果当前线程就是主线程,也就是U...
分类:
其他好文 时间:
2014-12-31 15:56:43
阅读次数:
209
执行update语句的时候发现执行半天不成功update main_order set order_source = '2', order_status = '2'查询哪些对象被锁select object_name, machine, s.sid, s.serial#fro...
分类:
数据库 时间:
2014-12-31 11:13:54
阅读次数:
412
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:100 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];
分类:
移动开发 时间:
2014-12-30 16:42:32
阅读次数:
239
Atitit.线程 死锁 跑飞 的检测与自动解除 与手动解除死锁 java c# .net php javascript.
1. 现象::主程序卡住无反应,多行任务不往下执行 1
2. 原因::使用jv jprofile查看线程,原来俩个线程死锁了。。 1
3. Java的缺点,默认不能自动解除死锁 1
4. 自动检测与解除死锁::使用看门狗watchdog 2
4.1. 死锁检...
分类:
编程语言 时间:
2014-12-28 00:33:58
阅读次数:
602