• 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 to make Array of NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make Array of NSString


  • Subject: Re: How to make Array of NSString
  • From: Greg Titus <email@hidden>
  • Date: Mon, 10 Nov 2003 10:09:52 -0800

On Nov 10, 2003, at 8:21 AM, Jay Rimalrick wrote:

How do you make an array of NSStrings?

I tried NSString myString[50];

however when I try

myString[0] = @"text";

I get a warning/error

That's because you want an array of pointers to NSStrings:

NSString *myString[50];

You can't ever have statically allocated Objective-C objects (that is, you always need to declare variables as pointers to objects, not the objects themselves).

Hope this helps,
- Greg
_______________________________________________
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: 
 >How to make Array of NSString (From: "Jay Rimalrick" <email@hidden>)

  • Prev by Date: Re: DataSource class of NSTableView - weird
  • Next by Date: Re: DataSource class of NSTableView - weird
  • Previous by thread: Re: How to make Array of NSString
  • Next by thread: Separator bar in NSMenu
  • Index(es):
    • Date
    • Thread