一、iOS9中UIAlertController的简单使用 很明显,简单的UIAlertView已经不能用了,我感觉很伤心。 // 创建 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"开始了" ...
分类:
移动开发 时间:
2015-10-03 18:13:40
阅读次数:
479
创建一个 Timer+ scheduledTimerWithTimeInterval: invocation: repeats:+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocatio...
分类:
其他好文 时间:
2015-09-29 23:28:56
阅读次数:
240
使用NSTimer的类#import "TBTimerTestObject.h"#import "TBWeakTimerTarget.h"@interface TBTimerTestObject()@property (nonatomic, weak) NSTimer *timer;@end@imp...
分类:
移动开发 时间:
2015-09-29 18:23:21
阅读次数:
308
NSTimer?*myTimer?=?[NSTimer?timerWithTimeInterval:3.0?target:self?selector:@selector(timerFired)?userInfo:nil?repeats:NO];
????[[NSRunLoop??currentRunLoop]?addTimer:_myTimer?forMode...
分类:
其他好文 时间:
2015-09-29 15:09:51
阅读次数:
190
原文: http://blog.csdn.net/kylinbl/article/details/8972261方法1:使用NSTimer来实现 主要使用的是NSTimer的scheduledTimerWithTimeInterval方法来每1秒执行一次timeFireMethod函数,tim...
分类:
移动开发 时间:
2015-09-28 14:30:46
阅读次数:
135
创建僵尸类zomb,继承UIIV把VC的即使时间timer放到僵尸类的初始化方法中- (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [NSTimer sc...
分类:
移动开发 时间:
2015-09-27 09:57:05
阅读次数:
311
#define COLOR_VALUE arc4random() % 256 /255.0//宏定义@interface FirstViewController (){ NSTimer *_timer;}//定义一个事件的属性[self createBackCorlor];//方法的调用#pragm...
分类:
其他好文 时间:
2015-09-25 21:44:23
阅读次数:
319
1. Stopping a Timer 关闭定时器if you create a non-repeating timer, there is no need to take any further action. It automatically stops itself after it fire...
分类:
移动开发 时间:
2015-09-23 16:44:33
阅读次数:
228
以前没怎么了解过这个NSTimer,其实还是有挺多坑的,今天来总结一下:首先我们一起来看这个:我在A -> (push) -> B控制器,然后再B控制器中开启了一个NSTimer。然后我又pop到A pop到A的时候,定时器还在运行,并且B没有被释放(未调用dealloc)。why?这就不得不让我....
分类:
移动开发 时间:
2015-09-22 14:28:01
阅读次数:
441
定义一个全局时间变量 NSTimer*_timer;创建时间变量 并调用定时器方法- (void)viewDidLoad{[super viewDidLoad];_timer= [NSTimerscheduledTimerWithTimeInterval:1target:selfselector:@...
分类:
其他好文 时间:
2015-09-21 19:30:05
阅读次数:
149