2012-02-17 2 views
1

나는 다른 함수에 포인트를 많이 통과하는 기능을 사용하려면,하지만 엑스 코드가있는 라인에 오류가 있습니다 : 포인트를 추가사용 CGPoint

이 가득 ...... CGContextAddLines (CGContextRef) 컨텍스트 - (무효) constructPoints

CGPoint의 addPoints [] = { CGPointMake (10,10) CGPointMake (10,10)는, }

사용 : 추천 정보 withPoints : (CGPoint) addPoints {

// do some context set attributes, color 
// and 

CGContextAddLines (context, addPoints, sizeof (addPoints)/sizeof (addPoints [0])));

// 및 인출이

}

답변

1

같이 그것을 시도 : 통화에 그런

-(void) constructPoints:(CGContextRef) context withPoints:(CGPoint[]) addPoints numPoints:(int) size { 
    // do some context set attributes, color 
    // and 
    CGContextAddLines(context, addPoints, size); 

    // and draw-it 

} 

: 당신의 도움에 대한

[self constructPoints:yourContext withPoints:addPoints numPoints:sizeof(addPoints)/sizeof(addPoints[0])]; 
+0

감사합니다, 그것을 잘 작동합니다 –

+0

사용하기에 기뻐하고 그것이 효과가 있으면 대답을 받아 들여도됩니다. –