Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Roarke Lynch <email@hidden>
- Date: Sat, 26 Aug 2000 03:40:13 -0400
On Saturday, August 24, 2002, at 04:15 PM, Onar Vikingstad wrote:
I have a problem with this line of code:
NSArray *arrayOfUser = [[[NSMutableArray alloc] initWithCapacity:2]
arrayWithObjects:[string componentsSeparatedByString:@":"], nil];
[string self] is in this example just dsad:FAFI.F6b3H1OU and when I run
this line, I get:
2002-08-24 22:06:16.639 Apache Protect[1031] *** -[NSCFArray
arrayWithObjects:]: selector not recognized
2002-08-24 22:06:16.654 Apache Protect[1031] *** -[NSCFArray
arrayWithObjects:]: selector not recognized
What is wrong here? Why isn't the array created?
arrayWithObjects is a class method, which you are calling onto a
class instance. You should either be calling [NSArray( or
NSMutableArray) arrayWithObjects:blah, blah, nil] or [[NSArray( or
NSMutableArray) alloc] initWithObjects:blah, blah, nil]. Also, your code
would create an NSMutableArray containing one object, an NSArray. Just
pointing that out.
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.