On Mon, Jan 19, 2009 at 2:36 AM, Bill Bumgarner <b...@mac.com> wrote: > On Jan 18, 2009, at 9:05 PM, Michael Ash wrote: >>> >>> For now. Someday, that might change. >> >> I sure hope not! The documentation for the method states: >> >> "The init method defined in the NSObject class does no initialization; >> it simply returns self." >> >> Making it do anything else would be a serious breach of the API contract. >> >> However I strongly advocate calling it anyway, as it makes your code >> more robust if you change the superclass later on to something that >> really does do something in init. > > Exactly > > I didn't say *who* might change it! > > It is quite common to.... > > - create a subclass of NSObject > > - create another subclass of NSObject > > - realize that A and B have a bit in common... > > - ... and create a common superclass from which A and B can share > functionality > > By following the rules with consistency throughout your code, you minimize > the pain of maintenance and transmogrification over time.
That's sensible, then. I thought you meant that the implementation of -[NSObject init] might change someday. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com