I want to share another debugging tip, this something that applies to the final step of building an iPhone project, linking.
I was able to successfully compile a project that I’ve been working on, however, the build process generated an error that two symbols could not be found, CGRectZero and CGRectOffset.
The figure below shows the specific error messages (ignore the first error about .objc_class_name_BirdView for now).
As far as the error regarding CGRectZero, here’s what I found, if you add the CoreGraphics.framework to your list of frameworks, all is well (I’ll talk more about adding frameworks in a future post as there are a few not-so-obvious things I want to point out). The Frameworks section in the Groups and Files will look similar to the figure below once the framework is in place.
There is a second option for fixing the problem is to replace the references to CGRectZero with CGRectMake(0,0,0,0). According to the CGGeometry reference, the zero rectangle is equivalent to the CGRectMake call.
As far as the error message regarding CGRectOffset, this message went away as well once the proper framework was included.
The question that I have is how did the compiler resolve the references to CGRectZero and CGRectOffset? I didn’t include any header files (other than header files that I wrote) in the implementation code. If you can share any insight on this, please post a comment.