NSRect, NSPoint, NSSize & Collections
NSRect, NSPoint, NSSize & Collections
- Subject: NSRect, NSPoint, NSSize & Collections
- From: Jeff LaMarche <email@hidden>
- Date: Sun, 27 Oct 2002 21:25:24 -0800
What do you do in Cocoa when you need to put a struct like NSRect or
NSPoint into an array? These are not formal objective-C objects, so I'm
assuming I can't shove them into an NSArray (although correct me if I'm
wrong in that assumption).
I see a couple of options. I could use the Foundation functions
NSRectFromString and NSStringFromRect and store them as an NSString,
but it seems like there might be a performance penalty with this. My
application isn't overly performance-sensitive, but...
I could also use the Java approach of creating "wrapper" objects (e.g.
in Java you store a float in a collection using Float, and int using
Integer, etc.). It seems like this would add some overhead and possibly
have a performance impact as well.
Can someone clue me in as to which of the above methods is better, or
if there's another option that I've overlooked?
Thanks.
- Jeff
_______________________________________________
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.