• 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: Appropriate -setWantsLayer: timing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appropriate -setWantsLayer: timing


  • Subject: Re: Appropriate -setWantsLayer: timing
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 19 Feb 2010 12:16:31 -0800
  • Thread-topic: Appropriate -setWantsLayer: timing

On Wed, 17 Feb 2010 17:07:54 -1000, Dave Keck <email@hidden> said:
>> Maybe I'm misunderstanding, but I'm wondering, why not put everything into a
>> single method and call that method from both initWithFrame and awakeFromNib?
>> One and only one of these will be called (depending whether you are
>> instantiating in code or in a nib), so your single method will be called
>> exactly once and you're off to the races. m.
>
>This isn't true for 10.5; both -initWithFrame: and -awakeFromNib are
>called if the view was instantiated via the NIB machinery. I suspect
>10.6 is no different.

OK, but in that case I would use a flag to make sure that my single method
is called no more than once.

I don't know whether this applies to the OP's actual use case; I'm just
saying, when I am not sure which of several routines will be called or in
what order and I want to make sure a certain thing happens, I just factor
out that certain thing. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



_______________________________________________

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

  • Prev by Date: Re: setAction:@selector is not working ?
  • Next by Date: Re: setAction:@selector is not working ?
  • Previous by thread: Re: Appropriate -setWantsLayer: timing
  • Next by thread: Preventing system sleep
  • Index(es):
    • Date
    • Thread