• 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: Storing NSRect in an NSMutableArray...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing NSRect in an NSMutableArray...


  • Subject: Re: Storing NSRect in an NSMutableArray...
  • From: David P Henderson <email@hidden>
  • Date: Tue, 3 Sep 2002 19:52:27 -0400

On Tuesday, Sep 3, 2002, at 03:03 US/Eastern, Andrew Duncan wrote:

On Monday, September 2, 2002, at 10:43 PM, Jiva DeVoe wrote:

Here's a problem I seem to hit more often than I'd like. I want to
create
an NSMutableArray of NSRects. The problem is, an NSRect is a struct,
It's
not a real class. So if I do this, NSMutableArray will blow up. How
do I
get around this?

At 10:54 PM -0700 02/09/2002, Kenneth C. Dyke wrote:
You could use NSValue to wrap the NSRect data for you, or write your
own dedicated wrapper class.


You can write your own wrapper, but using NSValue also works handily enough.

I know because I ran into the same thing myself a few days ago. :o)

Additionally, you can convert NSRects into NSStrings using the Foundation function NSStringFromRect() and its corollary NSRectFromString(), depending on your usage needs.

Dave
--
Chaos Assembly Werks
"A lie can run around the world before the truth can get its boots on."
- Israel Zangwill (not Edward R. Murrow)
_______________________________________________
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: Storing NSRect in an NSMutableArray...
      • From: Mike Shields <email@hidden>
References: 
 >Re: Storing NSRect in an NSMutableArray... (From: Andrew Duncan <email@hidden>)

  • Prev by Date: Re: General doubt... textured or not?
  • Next by Date: Re: cString deprecated!
  • Previous by thread: Re: Storing NSRect in an NSMutableArray...
  • Next by thread: Re: Storing NSRect in an NSMutableArray...
  • Index(es):
    • Date
    • Thread