• 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: Multidimensiaon Arrays in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multidimensiaon Arrays in Cocoa


  • Subject: Re: Multidimensiaon Arrays in Cocoa
  • From: John Hörnkvist <email@hidden>
  • Date: Sun, 23 Sep 2001 14:02:09 +0200

On Sunday, September 23, 2001, at 01:35 PM, email@hidden wrote:

Am I missing something or are there no multidimensional arrays in Cocoa's NSArray? What do we do, just implement them the old fashioned way with Objective-C?

You can implement it with NSArray.

But multidimensional arrays are not quite as easy to handle in a single class as arrays; their implementation is far more application dependent.

Eg, a matrix brings in the assumption that all rows have the same size. Your matrix class should be able to handle that. A matrix is often quite sparse, and very large, so the class should handle that.

On the other hand, if your 2D array is representing something else, then you may want different row lengths, and the ability to dynamically grow the rows.

Each case is reasonably easy to implement on top of a Foundation object (and some as C arrays). However, Foundation couldn't support all of them without becoming bloated.

Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com


References: 
 >Multidimensiaon Arrays in Cocoa (From: email@hidden)

  • Prev by Date: Re: Stopping a DO work
  • Next by Date: Re: Stopping a DO work
  • Previous by thread: Re: Multidimensiaon Arrays in Cocoa
  • Next by thread: Re: Multidimensiaon Arrays in Cocoa
  • Index(es):
    • Date
    • Thread