• 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: Disturbing Control Problem in Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disturbing Control Problem in Tiger


  • Subject: Re: Disturbing Control Problem in Tiger
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 23 Jun 2005 10:21:01 -0500

On 23 Jun 2005, at 9:51 AM, John Nairn wrote:

I tried to simplify the code in the example and made an error on the btnCell and srcCell. Yes they are actually different. Using the default initializer makes not difference because I set the frame in the next line anyway (I tried it to be sure).

The reason that there are designated initializers is that they contain initialization code that is necessary to the correct operation of the object, and is not contained in the -init method. In the case of NSView subclasses, it is a mistake to assume that


    aButton = [[NSButton alloc] initWithFrame: aFrame];

does nothing more than

    aButton = [[NSButton alloc] init];
    [aButton setFrame: aFrame];

Code that works properly under that assumption can break in later versions of the frameworks, as the rules about designated initializers say such assumptions are not valid.

    -- F

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Disturbing Control Problem in Tiger (From: John Nairn <email@hidden>)
 >Re: Disturbing Control Problem in Tiger (From: Fritz Anderson <email@hidden>)
 >Re: Disturbing Control Problem in Tiger (From: John Nairn <email@hidden>)

  • Prev by Date: Re: Disturbing Control Problem in Tiger [Solved]
  • Next by Date: Using -mouseEntered/Exited in a tab view
  • Previous by thread: Re: Disturbing Control Problem in Tiger
  • Next by thread: Re: Disturbing Control Problem in Tiger [Solved]
  • Index(es):
    • Date
    • Thread