Put NSRects into an array, as objects?

1.8k views Asked by At

I want to make a NSMutableArray and fill it up with rectangles created with, say, NSRectMake. But the array only allows objects. What should I do to save the NSRects in an array?

1

There are 1 answers

5
AliSoftware On BEST ANSWER

Use NSValue that's especially designed for that stuff. In your case, use valueWithRect:

Everything is explained here in Apple's corresponding Programming Guide.