• 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: Deferring a selector until later, but before painting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deferring a selector until later, but before painting


  • Subject: Re: Deferring a selector until later, but before painting
  • From: John Stiles <email@hidden>
  • Date: Thu, 06 Mar 2008 14:19:27 -0800

Ken Ferry wrote:
On Thu, Mar 6, 2008 at 2:06 PM, John Stiles <email@hidden> wrote:
 Ken Ferry wrote:
 On Thu, Mar 6, 2008 at 9:59 AM, John Stiles <email@hidden> wrote:


On Leopard, this solution works perfectly. I get a chance to update my view right before it draws, which is exactly what the doctor ordered.

 Any way to get this on Tiger or am I just out of luck?

 Out of luck. Well, you can do the work in -drawRect:, but if any of
the work you do invalidates display, it'll be delicate code (meaning
it may be hard to get it to work right, or relatively fragile between
releases). It might be good to implement a -resolveInvalidatedStuff
method, then call it from both -viewWillDraw and -drawRect:. Then, on
Leopard, you'll never actually be doing any work in drawRect: because
you will have already resolved all state. If it works on Tiger at
that point, great, and if not, any further tricky work you do is
targeting an unchanging OS. Make sense?


Hmm. What I'm doing is almost certainly going to invalidate display, so I am probably just out of luck for Tiger.

If there was some bulletproof solution that could be made to work under
Tiger, that would have been nice, but it's not a big deal. I don't currently
anticipate this code being used under Tiger. I just like to write things so
that we could use them as far back as reasonably possible, in case plans
change. I guess if that does happen, I can bring back the old code and Tiger
users can live with the controls-changing-after-display behavior that we had
before.

Note that implementing -viewWillDraw won't keep your code from running on Tiger, the method just won't get called. That's what I was getting at with the hybrid drawRect:/viewWillDraw approach.

Right. So I can leave it implemented, but for Tiger, I can check the AppKit version and if it's below the Leopard value, I can call my method via -performSelector:withObject:afterDelay: and get the same effect. It just will have a brief "blink." I suppose I could also experiment with disabling screen updates to get past that hurdle.

Honestly, for now, it's probably not all that important... I'll just accept that Tiger has limitations, and if I end up needing to target Tiger after all, I'll worry about it then. For now I'll stay focused on Leopard.

Thanks for your suggestions; I appreciate the help!
_______________________________________________

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


References: 
 >Deferring a selector until later, but before painting (From: John Stiles <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: j o a r <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: Ken Ferry <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: j o a r <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: John Stiles <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: John Stiles <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: John Stiles <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: "Ken Ferry" <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: John Stiles <email@hidden>)
 >Re: Deferring a selector until later, but before painting (From: "Ken Ferry" <email@hidden>)

  • Prev by Date: Re: Deferring a selector until later, but before painting
  • Next by Date: Re: Using an auto incremented NSNumber as attribute in a NSManagedObject
  • Previous by thread: Re: Deferring a selector until later, but before painting
  • Next by thread: Re: Deferring a selector until later, but before painting
  • Index(es):
    • Date
    • Thread