Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 545
Voldemort Avatar asked Dec 04 '25 19:12

Voldemort


1 Answers

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

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

like image 56
AliSoftware Avatar answered Dec 06 '25 10:12

AliSoftware



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!