Re: Pause during drawing
Re: Pause during drawing
- Subject: Re: Pause during drawing
- From: Graham Cox <email@hidden>
- Date: Wed, 10 Nov 2010 16:01:13 +1100
On 10/11/2010, at 4:23 AM, Siegfried wrote:
> The question is:
> Is it possible to "pause" after each call to -drawTriangle say for 0.25 second and redisplay the view, so I can see each triangle being draw?
Yes, but you need to refactor your code. Just inserting a delay while drawing is a bad idea and won't work.
Set up a timer that calls every 0.25 seconds. Each time the timer fires, increment an ivar that controls which level of triangle is being drawn, and mark the display as needing refresh (-setNeedsDisplay:). Then, in-drawRect:, use the 'current triangle' ivar to do the relevant part of the drawing.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden