• 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: How to add my custom structure to NSMutable Array??Pls help.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add my custom structure to NSMutable Array??Pls help.


  • Subject: Re: How to add my custom structure to NSMutable Array??Pls help.
  • From: Jeff Harrell <email@hidden>
  • Date: Fri, 11 Jul 2003 12:50:58 -0500

On Friday, July 11, 2003, at 10:42 AM, M. Uli Kusterer wrote:

Well, it gets the job done. But what he should really be doing, I suppose, is declare an Objective-C class derived from NSObject and have that contain a myStruct member variable. And then he would put that in the NSMutableArray. That would be more OOP.

I've never been of the opinion that you should do things the object-oriented way just to say that you did. My opinion is that you should do what works. Structs are nice, simple, lightweight constructs. Heck, NSPoint, NSSize, and NSRange are all structs.

In this case, I would vote for Dylan's suggestion of an NSValue wrapped around a pointer to a struct.

--
email@hidden
http://homepage.mac.com/jharrell
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to add my custom structure to NSMutable Array??Pls help.
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >Re: How to add my custom structure to NSMutable Array??Pls help. (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: Copying Oddity
  • Next by Date: Re: Temperature Converter example
  • Previous by thread: Re: How to add my custom structure to NSMutable Array??Pls help.
  • Next by thread: Re: How to add my custom structure to NSMutable Array??Pls help.
  • Index(es):
    • Date
    • Thread