When I need to add a integer to an array I use
[myArray addObject:[NSNumber numberWithInt:myInt]];
but what about CGPaths? How do I add them to the array?
I need something like
"[NSValue valueWithCGPath:myPath]"... ???!!!
any clues? thanks
The easiest way if you can target iOS 3.2 or higher is to wrap the CGPathRef
in a UIBezierPath
:
[myArray addObject:[UIBezierPath bezierPathWithCGPath:myPath]];
If you need to support earlier iOS versions, you can use a CFArray
instead of NSArray
because CGPath
derives from CFType
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With