开发者

Comparing an objects center to a point?

I've tried this.

if (crackerButton.center == CGPoint(190,135)) 开发者_如何学编程{
//Do something 
}

Didn't work.

Any ideas?

Cheers Newbie


Use :

if(CGPointEqualToPoint(crackerButton.center, CGPointMake(190,135)))
{
    //Do something 
}


I take it you're making a Christmas app then?

if (crackerButton.center == CGPointMake(190, 135)) {
//Do something 
}


Use the CGPointMake function to create a CGPoint.

if (crackerButton.center == CGPointMake(190, 135)) {
  ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜