Mutable array for NSRect and similar types.

Discussion in 'Mac Programming' started by gekko513, Aug 14, 2006.

  1. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #1
    What are good options for storing types that aren't NSObjects in an array type structure with dynamic size?

    I guess I could use NSMutableArray and box the types in objects for instance with the NSStringFromRect type functions, but that sounds like quite some overhead and I need this to go fast.

    Edit: Found the answer:
    Wrap each NSRect in an NSValue, and use an NSMutableArray as usual.
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Good to know. I always wondered what NSValue was used for.
     

Share This Page