Search code examples
iphoneipad

The Difference between Cocoa and Cocoa Touch


I am a beginner to iPhone development, I know the only very basic concepts of it. While I'm reading, I got a small question, what is the main difference between cocoa and cocoa touch?

Can anyone one please help?


Solution

  • Cocoa is for Mac OS X, Cocoa Touch for iOS. In Cocoa Touch, the UI classes all start with the prefix "UI" as in "UIButton", "UIView", etc. pp. while in Cocoa, the have the "NS" prefix as in "NSButton", "NSButton" (the NS stands for NextStep which is a predecessor to Mac OS X).

    Cocoa has more features than Cocoa Touch. But overall their APIs are very similar (they are not the same, but you will likely find it easy to find your way in one API if you already know the other).