I\'m trying to use CGPathApply to iterate over each CGPathElement in a CGPathRef object (mainly to write a custom way to persist CGPath data). The problem is, each time it get
element->points
is a C array of CGPoint
's, you can't print it out with that format specifier.
The trouble is, there's no way to tell how many elements that array holds (none that I can think of anyway). So you'll have to guess based on the type of operation, but most of them take a single point as an argument (CGPathAddLineToPoint, for example).
So a proper way to print it out would be
CGPoint pointArg = element->points[0];
NSLog(@"Type: %@ || Point: %@", element->type, NSStringFromCGPoint(pointArg));
for a path operation that takes a single point as an argument.
Hope that helps!