PDA

View Full Version : [Cocoa e Objective-C] Qual'è la differenza?


hollywoodundead
11-08-2013, 13:59
Direttamente dal developer center di Apple:



Cocoa Frameworks
The Cocoa and Cocoa Touch frameworks that power OS X and iOS are tightly integrated into the Xcode development experience. Cocoa’s high-level APIs make it easy to add animation, networking, and the native platform appearance and behavior to your application with only a few lines of code.

The Power of Objective-C
Much of Cocoa is implemented in Objective-C, an object-oriented language that is compiled to run at incredible speed, yet employs a truly dynamic runtime making it uniquely flexible. Because Objective-C is a superset of C, it is easy to mix C and even C++ into your Cocoa applications.

As your application runs, the Objective-C runtime instantiates objects based on executing logic—not just in ways defined during compilation. For example, a running Objective-C application can load an interface (a nib file created by Interface Builder), connect the Cocoa objects in the interface to your application code, then run the correct method once the UI button is pressed. No recompiling is necessary.

Objective-C’s dynamic runtime is similar to many modern scripting languages, making it easy to map Cocoa’s features to other languages using the Cocoa Bridge. With the Cocoa Bridge, developers can create first-class OS X apps using AppleScript, Ruby, and Python.

Non riesco a capire cosa sia realmente Cocoa. Un set di API contenute all'interno del linguaggio di programmazione Objective-C oppure è un linguaggio a parte con cui gestire la grafica e le animazioni? :)

[Kendall]
11-08-2013, 14:15
Direttamente dal developer center di Apple:





Non riesco a capire cosa sia realmente Cocoa. Un set di API contenute all'interno del linguaggio di programmazione Objective-C oppure è un linguaggio a parte con cui gestire la grafica e le animazioni? :)

Cocoa è il framework, Objective-C il linguaggio di programmazione.

Cocoa pertanto è un set (decisamente vasto) di API.

hollywoodundead
11-08-2013, 14:33
Quindi tramite l'objective-c vengono richiamate nel MVC le api contenute nel set cocoa? :)