Re: Disturbing Control Problem in Tiger
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