• 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: How do I create a NSArray of NSString constants?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How do I create a NSArray of NSString constants? (From: Scott Mitchell <email@hidden>)

  • Prev by Date: Re: DragNDropOutlineView Example Define Syntax
  • Next by Date: Re: How to find the manual (or at least the header)
  • Previous by thread: Re: How do I create a NSArray of NSString constants?
  • Next by thread: Re: How do I create a NSArray of NSString constants?
  • Index(es):
    • Date
    • Thread