• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Pause during drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Pause during drawing
      • From: Siegfried <email@hidden>
References: 
 >Pause during drawing (From: Siegfried <email@hidden>)

  • Prev by Date: ABPeoplePickerProblems
  • Next by Date: Re: Problem with redirecting stdout
  • Previous by thread: Pause during drawing
  • Next by thread: Re: Pause during drawing
  • Index(es):
    • Date
    • Thread