开发者

Calling view method on timer?

开发者 https://www.devze.com 2022-12-27 04:02 出处:网络
I have setup a view and I want to cycle the color of some text on that view usi开发者_如何转开发ng a timer. Is there a timer method for a view that gets called (or I can setup to get called) on a regu

I have setup a view and I want to cycle the color of some text on that view usi开发者_如何转开发ng a timer. Is there a timer method for a view that gets called (or I can setup to get called) on a regular basis?


You could use an NSTimer with the following method:

timerWithTimeInterval:target:selector:userInfo:repeats:

Look here for further information:

http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html#//apple_ref/occ/clm/NSTimer/timerWithTimeInterval:target:selector:userInfo:repeats:


NSTimer will work for you as long as you don't require "fine" precision -- like sub-100ms.

Core Animation may work here as well. Are you animating a UILabel or are you rendering the text directly into the view with Core Graphics calls (or OpenGL)?

0

精彩评论

暂无评论...
验证码 换一张
取 消