Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Difference between Cocoa and Cocoa Touch

Tags:

iphone

ipad

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?

like image 748
ajay Avatar asked Nov 11 '10 12:11

ajay


2 Answers

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).

like image 146
DarkDust Avatar answered Sep 28 '22 01:09

DarkDust


As told very well by DarkDust would like to add few more points.

The main difference between Cocoa and Cocoa touch is that the UI classes and APIs aren't the same as Mac OS X, so instead of NSTextField, you have UITextField.

Cocoa is the application framework for Mac OS X.

Cocoa Touch is the application framework for iPhone and iPod Touch - very similar to Cocoa.

Cocoa is commonly referred to as the combination of the Foundation and AppKit frameworks.
Cocoa Touch is the combination of the Foundation and UIKit frameworks

There are also some differences between the Foundation frameworks in Cocoa and Cocoa Touch, most commonly missing classes, eg, Cocoa has NSHost and Cocoa Touch does not.

like image 34
Akash Avatar answered Sep 28 '22 02:09

Akash