¡@

Home 

2014/10/15 ¤U¤È 10:12:48

iphone Programming Glossary: points.count

Drawing Smooth Curves - Methods Needed

http://stackoverflow.com/questions/8702696/drawing-smooth-curves-methods-needed

NSInteger granularity NSMutableArray points NSMutableArray self pointsOrdered mutableCopy if points.count 4 return self bezierPath Add control points to make the math make sense points insertObject points objectAtIndex 0 atIndex.. self bezierPath smoothedPath removeAllPoints smoothedPath moveToPoint POINT 0 for NSUInteger index 1 index points.count 2 index CGPoint p0 POINT index 1 CGPoint p1 POINT index CGPoint p2 POINT index 1 CGPoint p3 POINT index 2 now add n points.. pi Now add p2 smoothedPath addLineToPoint p2 finish by adding the last point smoothedPath addLineToPoint POINT points.count 1 return smoothedPath PVPoint pointAppendingCGPoint CGPoint CGPoint PVPoint newPoint PVPoint alloc initInsertingIntoManagedObjectContext..