• 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
NSRect, NSPoint, NSSize & Collections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSRect, NSPoint, NSSize & Collections
      • From: Chris Hanson <email@hidden>
    • Re: NSRect, NSPoint, NSSize & Collections
      • From: David Remahl <email@hidden>
  • Prev by Date: Re: Window zoom with a tableView
  • Next by Date: Re: NSRect, NSPoint, NSSize & Collections
  • Previous by thread: Re: Window zoom with a tableView
  • Next by thread: Re: NSRect, NSPoint, NSSize & Collections
  • Index(es):
    • Date
    • Thread