【问题标题】:No member named 'frame' in struct CGRect结构 CGRect 中没有名为“框架”的成员
【发布时间】:2012-09-18 03:59:08
【问题描述】:

我收到错误“结构 CGRect 中没有名为 'frame' 的成员”。

    UITouch *touch = [[event2 allTouches] anyObject];
CGPoint touchlocation = [touch locationInView:self.view];
if ( CGRectContainsPoint( enemy.frame, touchlocation ) ) {
    MedalGo = 0;
    // inside imgView
} else {
    // outside imgView Now we will found out is it within proximityImgViewRect
    CGRect proximityImgViewRect = CGRectMake( enemy.frame.origin.x-25,enemy.frame.origin.y - 25, enemy.frame.size.width+50,enemy.frame.size.height+50);
    if ( CGRectContainsPoint( proximityImgViewRect.frame, touchlocation ) ) {
        // inside proximityImgViewRect
        MedalGo = 1;

    } else {
        //outside proximityImgViewRect
        MedalGo = 0;
    }
}

任何帮助将不胜感激。谢谢。

【问题讨论】:

    标签: frame cgrect


    【解决方案1】:

    CGRect 是框架。

     if ( CGRectContainsPoint( proximityImgViewRect.frame, touchlocation ) )
    

    没有

     if ( CGRectContainsPoint( proximityImgViewRect, touchlocation ) )
    

    是的

    【讨论】:

      猜你喜欢
      • 2013-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多