¡@

Home 

2014/10/15 ¤U¤È 10:13:50

iphone Programming Glossary: self.points

iPad (very) simple drawing

http://stackoverflow.com/questions/3956202/ipad-very-simple-drawing

if self super initWithFrame frame self.backgroundColor UIColor blueColor return self void drawRect CGRect rect if self.points.count 0 return CGContextRef context UIGraphicsGetCurrentContext CGContextSetRGBStrokeColor context 1.0 1.0 1.0 1.0 white.. CGContextSetRGBStrokeColor context 1.0 1.0 1.0 1.0 white CGContextSetLineWidth context 1.0 CGPoint firstPoint self.points objectAtIndex 0 CGPointValue CGContextBeginPath context CGContextMoveToPoint context firstPoint.x firstPoint.y int i 1 while.. 0 CGPointValue CGContextBeginPath context CGContextMoveToPoint context firstPoint.x firstPoint.y int i 1 while i self.points.count CGPoint nextPoint self.points objectAtIndex i CGPointValue if nextPoint.x 0 nextPoint.y 0 CGContextDrawPath context..