![[Cocoa]_[初级]_[NSTimer在Cocoa中的应用,主要以多张图片切换的播放和停止],第1张 [Cocoa]_[初级]_[NSTimer在Cocoa中的应用,主要以多张图片切换的播放和停止],第1张](/aiimages/%5BCocoa%5D_%5B%E5%88%9D%E7%BA%A7%5D_%5BNSTimer%E5%9C%A8Cocoa%E4%B8%AD%E7%9A%84%E5%BA%94%E7%94%A8%EF%BC%8C%E4%B8%BB%E8%A6%81%E4%BB%A5%E5%A4%9A%E5%BC%A0%E5%9B%BE%E7%89%87%E5%88%87%E6%8D%A2%E7%9A%84%E6%92%AD%E6%94%BE%E5%92%8C%E5%81%9C%E6%AD%A2%5D.png)
主要说明NSTimer的具体实用。Creating a Timer+ scheduledTimerWithTimeInterval:invocation:repeats:+ scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:+ timerWithTimeInterval:invocation:repeats:+ timerWithTimeInterval:target:selector:userInfo:repeats:– initWithFireDate:interval:target:selector:userInfo:repeats:Firing a Timer– fireStopPing a Timer– invalIDateinformation About a Timer– isValID– fireDate– setFireDate:– timeInterval– userInfo-(IBAction) onPlay:(ID)sender{ if(timer == nil) { timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(checkThem:) userInfo:nil repeats:YES] ; } else { [timer invalIDate]; i = 0; timer = nil; }}-(voID) checkThem:(NSTimer *) aTimer{ NSLog(@"checkThem"); Nsstring *path =[paths objectAtIndex:i];//paths:deposit a lot of the imagefilePath dosomething.....//主要是图片的显示,自定义view ++i; if((i+1) == [paths count]) { i = 0; } } 总结 以上是内存溢出为你收集整理的[Cocoa]_[初级]_[NSTimer在Cocoa中的应用,主要以多张图片切换的播放和停止]全部内容,希望文章能够帮你解决[Cocoa]_[初级]_[NSTimer在Cocoa中的应用,主要以多张图片切换的播放和停止]所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)