如何將變量設置爲CGMakePoint
?將變量設置爲CGPointMake
我試過設置,並呼籲在以下方面變量:
我預計這一項工作。
float p0[] = {0, 100};
UIBezierPath *point = [[UIBezierPath alloc] init];
[point moveToPoint:CGPointMake(p0)]; // this tells me I need two arguments
不是!
float *p0 = CGPointMake(0, 100);
UIBezierPath *point = [[UIBezierPath alloc] init];
[point moveToPoint:p0];
失敗!
NSObject *p0 = CGPointMake(0, 100);
UIBezierPath *point = [[UIBezierPath alloc] init];
[point moveToPoint:p0];
另一個錯誤!
id p0 = CGPointMake(0, 100);
UIBezierPath *point = [[UIBezierPath alloc] init];
[point moveToPoint:p0];
該課程的標準!
NSString *p0 = @"CGPointMake(0, 100)";
UIBezierPath *point = [[UIBezierPath alloc] init];
[point moveToPoint:p0];
我猜我只是把它作爲錯誤的類型。我不一定需要設置我的變量= CGPointMake(0, 100)
,但我確實需要能夠將我的變量設置爲我的座標= (0, 100)
。
哈哈,你錯了,但還是對的。確實!我想你應該已經接受了其他答案,因爲它是正確的,他花時間來幫助你,並給你一個王牌的建議。歡呼聲 – prototypical