I am trying to create a re-sizable array of CGPoints in objective-c. I’ve have looked into using NSMutableArray however it doesnt seem to allow resizing. Is there something else I can use?
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use an
NSMutableArray, but just box yourCGPointstructs inNSValueobjects. Example:Note that the
+valueWithCGPoint:andCGPointValuemethods are only available on the iPhone. However if you need this for the Mac, there are similar methods for dealing withNSPoints, and it’s trivial to convert aCGPointto anNSPoint(you can cast or useNSPointFromCGPoint()).