• 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: Peter Ammon <email@hidden>
  • Date: Fri, 03 Aug 2001 09:30:40 -0700

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.

-Peter


  • Follow-Ups:
    • Re: Vectors?
      • From: Andreas Monitzer <email@hidden>
References: 
 >Vectors? (From: stuartbryson <email@hidden>)

  • Prev by Date: [ANN] Vermont Recipes 4 released
  • Next by Date: Re: What is a "parse error"?
  • Previous by thread: Re: Vectors?
  • Next by thread: Re: Vectors?
  • Index(es):
    • Date
    • Thread