Re: initialize an NSArray with a list of objects
Re: initialize an NSArray with a list of objects
- Subject: Re: initialize an NSArray with a list of objects
- From: Ryan Britton <email@hidden>
- Date: Tue, 16 May 2006 16:05:35 -0700
Sort of. You can't use the curly brackets, but you can initialize it
with a variable-length list.
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSArray.html#//apple_ref/occ/clm/NSArray/
arrayWithObjects:
On May 16, 2006, at 3:53 PM, David Alter wrote:
Is there a way to initialize an NSArray with a list of strings like
I can do in C
Example
the C way
char * myList[] = {"item1", "item2", "item3" }
I tried this, and it only picked up the first item
NSArray * myList = {@"item1", @"item2", @"item3" }
Thanks for the help
-dave
_______________________________________________
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
_______________________________________________
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