1

関数を使用して多くのポイントを別の関数に渡したいのですが、Xcodeに次の行にエラーがあります:CGContextAddLines ..... ..

追加ポイントには、次のような情報が入力されます。

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

-(void)constructPoints:(CGContextRef)コンテキストwithPoints:(CGPoint)addPoints{を使用します。

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

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

//そしてdraw-it

}

4

1 に答える 1

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])];
于 2012-02-17T22:38:44.507 に答える