• 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: James Housley <email@hidden>
  • Date: Mon, 27 Jun 2005 12:39:17 -0400

Scott Mitchell wrote:
Ok this may sound weird but here is what I need to do.

I need to create a constant NSArray of string constants that I have. So for example I have

NSString* GB_Submit_Period1 = @"GB_Submit_Period1";
NSString* GB_Submit_Period2 = @"GB_Submit_Period2";
NSString* GB_Submit_Period3 = @"GB_Submit_Period3";
NSString* GB_Submit_Period4 = @"GB_Submit_Period4";
NSString* GB_Submit_Period5 = @"GB_Submit_Period5";
NSString* GB_Submit_Period6 = @"GB_Submit_Period6";
NSString* GB_Submit_Period7 = @"GB_Submit_Period7";
NSString* GB_Submit_Period8 = @"GB_Submit_Period8";
NSString* GB_Submit_Period9 = @"GB_Submit_Period9";
NSString* GB_Submit_Period10 = @"GB_Submit_Period10";
NSString* GB_Submit_Period11 = @"GB_Submit_Period11";
NSString* GB_Submit_Period12 = @"GB_Submit_Period12";

and each of the @"<strings above>" is defined in my Localizable.strings file. 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" };


NSArray* GB_Period_Number_Strings_Array = [NSArray arrayWithObjects:@"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", nil];


That should do the trick for you.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
 X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden      http://www.FreeBSD.org     The Power to Serve
email@hidden  http://www.TheHousleys.net
---------------------------------------------------------------------
Do not meddle in the affairs of dragons, for you are crunchy and taste
    good with ketchup.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

 _______________________________________________
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

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

  • Prev by Date: Re: getting the bounds as seen by the user
  • Next by Date: Re: DragNDropOutlineView Example Define Syntax
  • Previous by thread: 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