Re: What classes have -init?

2010-02-11 Thread Kyle Sluder
On Thu, Feb 11, 2010 at 10:00 PM, Graham Cox wrote: > I don't think that's true. Surely by definition "THE designated initializer" > is a single specific method. No. http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/FrameworkImpl.html --Kyle Slu

Re: What classes have -init?

2010-02-11 Thread Graham Cox
On 12/02/2010, at 4:52 PM, Quincey Morris wrote: > since classes are allowed to have multiple designated initializers. I don't think that's true. Surely by definition "THE designated initializer" is a single specific method. The docs state: "The designated initializer is the method in each c

Re: What classes have -init?

2010-02-11 Thread Quincey Morris
On Feb 11, 2010, at 21:19, Michael Ash wrote: > You override the one that's documented to be the designated initializer. Or, all of the ones that are documented to be the designated initializers, since classes are allowed to have multiple designated initializers. The point I tried to make earli

Re: What classes have -init?

2010-02-11 Thread Michael Ash
On Fri, Feb 12, 2010 at 12:07 AM, Charles Srstka wrote: > On Feb 11, 2010, at 10:28 PM, Graham Cox wrote: > >> On 12/02/2010, at 1:43 PM, Gordon Apple wrote: >> >>> My point was that if all Cocoa classes called "init" >>> somewhere in their other initializers (or had a two-step initialization >>>

Re: What classes have -init?

2010-02-11 Thread Charles Srstka
On Feb 11, 2010, at 10:28 PM, Graham Cox wrote: > On 12/02/2010, at 1:43 PM, Gordon Apple wrote: > >> My point was that if all Cocoa classes called "init" >> somewhere in their other initializers (or had a two-step initialization >> similar to what MacApp did), then you could simply override (not

Re: What classes have -init?

2010-02-11 Thread Graham Cox
On 12/02/2010, at 1:43 PM, Gordon Apple wrote: > My point was that if all Cocoa classes called "init" > somewhere in their other initializers (or had a two-step initialization > similar to what MacApp did), then you could simply override (not call) > "init" for simple ivar initialization in a sub

Re: What classes have -init?

2010-02-11 Thread Scott Ribe
> My point was that if all Cocoa classes called "init" > somewhere in their other initializers (or had a two-step initialization > similar to what MacApp did), then you could simply override (not call) > "init" for simple ivar initialization in a subclass, which would in no way > interfere with a d

Re: What classes have -init?

2010-02-11 Thread Gordon Apple
in no way interfere with a designated initializer. Since they don't all call it, it's really academic. On 2/11/10 6:52 PM, "cocoa-dev-requ...@lists.apple.com" wrote: > Message: 2 > Date: Thu, 11 Feb 2010 12:18:55 -0800 > From: mmalc Crawford > Subject: Re: What

Re: What classes have -init?

2010-02-11 Thread mmalc Crawford
On Feb 11, 2010, at 12:08 pm, Gordon Apple wrote: > My point was that if you could count on "init" being called internally and > all you needed was to initialize some ivars, you could override "init" and > not have to override the (sometimes more involved) designated initializer > and possibly ot

Re: What classes have -init?

2010-02-11 Thread Gordon Apple
My point was that if you could count on "init" being called internally and all you needed was to initialize some ivars, you could override "init" and not have to override the (sometimes more involved) designated initializer and possibly other initializers. You could still use the (superclass) desi

Re: What classes have -init?

2010-02-11 Thread Greg Parker
On Feb 11, 2010, at 9:03 AM, Gordon Apple wrote: > It's unfortunate that all initializers don't at least call "init" > internally. That would make subclassing easier if all one needs is to set a > few ivars. In the earlier days of MacApp (Pascal and first C++ versions) > there was a basic initial

Re: What classes have -init?

2010-02-11 Thread Scott Ribe
> ...but it still would have been useful, sometimes > eliminating the need to override multiple initializers. Are you missing the point of the designated initializer? Or have you dealt with classes that did not have one, or did not use it properly? -- Scott Ribe scott_r...@killerbytes.com http:/

Re: What classes have -init?

2010-02-11 Thread James Walker
On 2/10/2010 8:38 PM, Quincey Morris wrote: On Feb 10, 2010, at 12:23 PM, James Walker wrote: I think at times I've written things like [[NSMutableArray alloc] init] with no apparent ill effects, but now I notice that the docs for NSMutableArray and NSArray don't say that there is an init metho

Re: What classes have -init?

2010-02-11 Thread Gordon Apple
It's unfortunate that all initializers don't at least call "init" internally. That would make subclassing easier if all one needs is to set a few ivars. In the earlier days of MacApp (Pascal and first C++ versions) there was a basic initializer, similar to "init", called by all classes, just for

Re: What classes have -init?

2010-02-10 Thread Quincey Morris
On Feb 10, 2010, at 12:23 PM, James Walker wrote: > I think at times I've written things like [[NSMutableArray alloc] init] with > no apparent ill effects, but now I notice that the docs for NSMutableArray > and NSArray don't say that there is an init method. The NSObject docs say > that an in

Re: What classes have -init?

2010-02-10 Thread Scott Anguish
True. But most classes have designated initializers that configure the class properly. They should be documented, although typically they’re used for subclassing the class. On Feb 10, 2010, at 3:49 PM, Henry McGilton (Boulevardier) wrote: > > On Feb 10, 2010, at 12:23 PM, James Walker wrote:

Re: What classes have -init?

2010-02-10 Thread Henry McGilton (Boulevardier)
On Feb 10, 2010, at 12:23 PM, James Walker wrote: > I think at times I've written things like [[NSMutableArray alloc] init] with > no apparent ill effects, but now I notice that the docs for NSMutableArray > and NSArray don't say that there is an init method. The NSObject docs say > that an i

What classes have -init?

2010-02-10 Thread James Walker
I think at times I've written things like [[NSMutableArray alloc] init] with no apparent ill effects, but now I notice that the docs for NSMutableArray and NSArray don't say that there is an init method. The NSObject docs say that an init method might raise an exception. Is there some other i