Convenience initialisers
Convenience initialisers
- Subject: Convenience initialisers
- From: DKJ <email@hidden>
- Date: Sun, 5 Jul 2009 10:40:05 -0700
I'm trying to write one of those convenient class initialisers for one
of my objects. On my still-incomplete understanding of these matters,
this is what I need to have:
Header:
+ (MyObject *)myObject;
Implementation:
+ (MyObject *)myObject
{
return [[[self alloc] init] autorelease];
}
(I'd have the usual init method in here as well, of course.)
Have I done this correctly? (My programme is crashing, but there are
plenty of other mistakes I may have made.)
I've been looking in the docs for an explicit example of this kind of
initialiser, but haven't found one yet.
dkj
_______________________________________________
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