Re: Vectors?
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>) |