The iPhone compiler, unfortunately, does not include any of the Cocoa/AppKit UI-oriented classes. This means your stuck with (sigh) CoreGraphics, or the CG- prefix, and the iPhone-specific UIKit with the UI- prefix, rather than the NS- (AppKit/Cocoa) classes you used to know and love. Listed below are some examples of these difference. We will begin with the rectangle structs.
NSRect nsRect = NSMakeRect(0.0f, 0.0f, 10.0f, 10.0f);
Whereas the equivalent in CoreGraphics:
CGRect cgRect = CGRectMake(0.0f, 0.0f, 10.0f, 10.0f);
By the way, nsRect and cgRect are the exact same internally. That is, the origin is defined as the bottom left corner (considering you didn’t change the coordinate plane), and the other 2 initializing components specify width and height from this point.
(more…)