• 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: Newbie Question: Multidimensional NSMutableArray Creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Question: Multidimensional NSMutableArray Creation


  • Subject: Re: Newbie Question: Multidimensional NSMutableArray Creation
  • From: Scott Anguish <email@hidden>
  • Date: Mon, 14 May 2001 11:52:45 -0400

On 5/14/01 5:35 AM, "William Jamieson" <email@hidden> wrote:

>
> I am new to java and java-cocoa programming and I have been trying to figure
> out a workaround to create a multidimensional NSMutableArray.
>
> I have a NSTableView (with 4 columns and a variable number of rows) in a
> window with a custom class as its DataSource. What I really want to do is
> have an Parent NSMutableArray that is an array of Rows (also
> NSMutableArrays). Thus creating a (workaround) multidimensional Array
> (similar to a String[][] in java).
>
> When I need to access cell data (eg. Row 3, Column 2) from the Array System


I'd not use a multi-dimensional array for this..

I'd suggest using instead an array of NSDictionary items... Since you
have a fixed number of horizontal fields (which are likely things like
"name" "Address" "city" "state" or some other set of keys that correspond
directly to your data) this would be very easy to do

In fact, have a look at this sample code.. It might help

http://homepage.mac.com/sanguish/SetTheTableView-1.0-src.tgz


  • Prev by Date: Re: NSOutlineView from Java or Bust
  • Next by Date: RE: Reaching the limits of 'learn by example'
  • Previous by thread: Re: Newbie Question: Multidimensional NSMutableArray Creation
  • Next by thread: Icon for docklings Icon for docklings
  • Index(es):
    • Date
    • Thread