开发者

Simple Question about CGRectIntersectsRect

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


Import the CoreGraphics framework also. (Not 100% how to think about the distinction between this and QuartzCore, but they are different.)


You want CGRectIntersectsRect, not GCRectIntersectsRect. 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 the QuartzCore framework.

Hope that helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜