Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Shawn Erickson <email@hidden>
- Date: Sat, 24 Aug 2002 13:29:33 -0700
On Saturday, August 24, 2002, at 01: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?
You are allocating and initing an array with [[NSMutableArray alloc]
initWithCapacity:2] and then are attempting to ask this instance to
service arrayWithObjects which is not an instance method but a class
method.
All you need is... [NSMutableArray arrayWithObjects:..,...,nil];
-Shawn
_______________________________________________
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.
References: | |
| >(no subject) (From: Onar Vikingstad <email@hidden>) |