• 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: Vectors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vectors?


  • Subject: Re: Vectors?
  • From: Andreas Monitzer <email@hidden>
  • Date: Fri, 3 Aug 2001 18:45:58 +0200

On Friday, August 3, 2001, at 06:30 , Peter Ammon wrote:

on 8/3/01 2:42 PM, stuartbryson at email@hidden wrote:

Hi all,

I am trying to create my own shape classes (sphere, cube etc) with an
abstract class called shape in order that I implement polymorphism. I
need however a container class. Coming from a C++ background, I would
normally use the STL vector class to do this. How might one produce a
similar result in Obj-C?


I believe that the analog of a vector in the STL is an NSMutableArray in
Foundation. Be aware, though, that you can only store objects (or, more
precisely, pointers to objects) in an NSMutableArray; you can't store
primitive types like ints.

However, you can store wrapped ints (NSNumber), wrapped binary data (NSData) and so on.

andy
--
Description forthcoming.


References: 
 >Re: Vectors? (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: Quick Question
  • Next by Date: Re: What is a "parse error"?
  • Previous by thread: Re: Vectors?
  • Next by thread: Re: Vectors?
  • Index(es):
    • Date
    • Thread