• 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: Raphael Sebbe <email@hidden>
  • Date: Fri, 3 Aug 2001 08:23:31 +0200

Just use NSArray or NSMutableArray. Those can contain any kind of ObjC objects.


Perhaps some useful notes for C++ programmers:

- all methods are "virtual" in ObjC.
- you have full "RTTI" support : [myObject isKindOfClass:aClass], [myObject isMemberOfClass:aClass], [myObject respondsToSelector:aSelector], [myObject class] ...

Raphael

On Friday, August 3, 2001, at 11:42 PM, stuartbryson 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?

Thanks in advance.

Stuart
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Vectors? (From: stuartbryson <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 1 #351 - 16 msgs
  • Next by Date: Re: Quick Question
  • Previous by thread: Vectors?
  • Next by thread: Re: Vectors?
  • Index(es):
    • Date
    • Thread