Saturn
Saturn

Reputation: 18149

Put NSRects into an array, as objects?

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?

Upvotes: 3

Views: 1921

Answers (1)

AliSoftware
AliSoftware

Reputation: 32681

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

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

Upvotes: 13

Related Questions