Re: Cannot Add an Custom -initWithArg: in a Category?
Re: Cannot Add an Custom -initWithArg: in a Category?
- Subject: Re: Cannot Add an Custom -initWithArg: in a Category?
- From: Tomas Franzén <email@hidden>
- Date: Tue, 24 Jan 2006 00:09:18 +0100
On Jan 23, 2006, at 21:07, Jerry Krinock wrote:
@interface NSMutableDictionary (BmItem)
+ (NSMutableDictionary*)initWithNodeType:(enum NodeType)nodeType ;
+ (NSMutableDictionary*)bmItemNodeType:(enum NodeType)nodeType ;
...
@end
Hi Jerry,
Looks like your init method is a class method, when it should most
likely be an instance method. That is, something like this should
work better:
- (NSMutableDictionary*)initWithNodeType:(enum NodeType)nodeType;
Then, instead of calling [[NSMutableDictionary alloc] init] from your
initializer, just call [self init]. Then use it like this:
NSMutableDictionary *m = [[NSMutableDictionary alloc]
initWithNodeType:...];
Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/
_______________________________________________
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