Re: How do I create a NSArray of NSString constants?
Re: How do I create a NSArray of NSString constants?
- Subject: Re: How do I create a NSArray of NSString constants?
- From: Cameron Hayne <email@hidden>
- Date: Mon, 27 Jun 2005 12:42:30 -0400
On 27-Jun-05, at 12:31 PM, Scott Mitchell wrote:
But what I really need to do is to create an NSArray of these
strings. So for example something like this
NSArray* GB_Period_Number_Strings_Array = {@"GB_Submit_Period1",
@"GB_Submit_Period2", @"GB_Submit_Period3", @"GB_Submit_Period4",
@"GB_Submit_Period5", @"GB_Submit_Period6", @"GB_Submit_Period7",
@"GB_Submit_Period8", @"GB_Submit_Period9", @"GB_Submit_Period10",
@"GB_Submit_Period11", @"GB_Submit_Period12" };
The {} notation is only used for "bare-metal" C arrays (and structures).
Your GB_Period_Number_Strings_Array is an object (pointer) and so you
need to create an object, either will 'alloc' and an appropriate
'init' method, or by using one of the convenience methods of the
NSArray class (e.g. arrayWithObjects:)
--
Cameron Hayne
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