(1) Effect
(2) source download (assuming that there is no small picture of the hint, you can find a replacement, see the effect can be)
http://download.csdn.net/detail/wsb200514/8176339
(3) Summary:
--Since the DrawRect method calls only 1 times, it is assumed that the graphics need to be refreshed and setneedsdisplay forced to invoke refreshes.
--there is also a way to use "timer", the following two kinds of similar
-(void) awakefromnib{ cadisplaylink *link=[cadisplaylink displaylinkwithtarget:self selector: @selector ( Setneedsdisplay)]; [link addtorunloop:[nsrunloop mainrunloop] formode:nsdefaultrunloopmode];// [Nstimer scheduledtimerwithtimeinterval:0.1 target:self selector: @selector (setneedsdisplay) Userinfo:nil Repeats:yes];}
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
"iOS Development-81" Setneedsdisplay refresh the video card and cadisplaylink it to simulate the timer effect