![](/img/trans.png)
[英]How to copy NSMutableArray value into another NSMutableArray in iPhone?
[英]iPhone - adding a CGPath to a NSMutableArray… how?
當我需要向我使用的數組添加整數時
[myArray addObject:[NSNumber numberWithInt:myInt]];
但是CGPaths怎么樣? 如何將它們添加到陣列?
我需要類似的東西
"[NSValue valueWithCGPath:myPath]"... ???!!!
任何線索? 謝謝
最簡單的方法,如果你能定位到iOS 3.2或更高版本是包裹CGPathRef
在UIBezierPath
:
[myArray addObject:[UIBezierPath bezierPathWithCGPath:myPath]];
如果您需要支持早期的iOS版本,則可以使用CFArray
而不是NSArray
因為CGPath
派生自CFType
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.