关于 CGRectIntersectsRect 的简单问题
我只有一个简单的问题。每次使用时,
CGRectIntersectsRect(view1.frame, view2.frame)
我都会收到链接器错误,指出链接器找不到编译此方法所需的文件。我确实导入了 QuartzCore,我假设还需要另一个标头。遗憾的是,在互联网上搜索却一无所获,而且我知道这绝对是一个我一直忽视的简单问题。任何答案都表示赞赏!
注意:我使用的是 XCode 4 和 iOS 5 beta
I just have one simple question. Everytime I use
CGRectIntersectsRect(view1.frame, view2.frame)
I get a linker error stating the linker cannot find the files necessary to compile this method. I do have QuartzCore imported, I'm assuming theres another header I need. Sadly scouring the internet has left me nowhere, and I known this is definetely a simple issue that I keep overlooking. Any answers are appreciated!
Notice: I am using XCode 4 and iOS 5 beta
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
还导入 CoreGraphics 框架。 (不是100%如何思考这和QuartzCore之间的区别,但它们是不同的。)
Import the CoreGraphics framework also. (Not 100% how to think about the distinction between this and QuartzCore, but they are different.)
您需要的是
CGRectIntersectsRect
,而不是GCRectIntersectsRect
。确保还将框架导入到您的项目中。编辑:您是否将
QuartzCore
框架添加到您的项目中?如果没有,请单击 Xcode 左上角运行下的蓝色项目图标,单击目标 ,然后在构建阶段选项卡下,选择将二进制文件与库链接选项,单击 +,然后添加QuartzCore
框架。希望有帮助!
You want
CGRectIntersectsRect
, notGCRectIntersectsRect
. Make sure you also import the frameworks into your project.EDIT: Did you add the
QuartzCore
framework to your project? If not, click on the blue project icon in the top left of Xcode under Run, click on the target, and under the Build Phases tab, select the Link Binary with Libraries option, click on the +, and then add theQuartzCore
framework.Hope that helps!