• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Kevin Callahan <email@hidden>
  • Date: Sat, 24 Aug 2002 13:45:57 -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];

you're calling an NSArray class method +arrayWithObjects: on an instance of NSMutableArray.

You might want to use the NSMutableArray instance method
-(void)addObjectsFromArray:(NSArray *)otherArray

NSArray *arrayOfUser =[[[NSMutableArray alloc] initWithCapacity:2] addObjectsFromArray: [string componentsSeparatedByString:@":"]];


Kevin



[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?



Kind regards,
newbie...

--
Onar Vikingstad - email@hidden
http://www.vikingstad.com
_______________________________________________
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.


- Kevin
o#?
_______________________________________________
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>)

  • Prev by Date: Re: (no subject)
  • Next by Date: where are the faster compilations?
  • Previous by thread: Re: (no subject)
  • Next by thread: Running Applescript from Cocoa
  • Index(es):
    • Date
    • Thread