Carbon vs Cocoa

Prepared By
Kaushal S Malvi
WiMC-13
131060753010
Agenda
•
•
•
•
•
•

Introduction of carbon
Introduction of cocoa
Carbon and Cocoa User Interface Communication
Event Communication Between Carbon & Cocoa
Main Difference of carbon & cocoa
Reference
What is Carbon :
• Carbon is one of Apple Inc.'s C-based application
programming interfaces (APIs) for the Macintosh
operating system.

• Carbon provides a good degree of backward
compatibility for programs that ran on the now-obsolete
Mac OS 8 and 9.
• Developers could use the Carbon APIs to port their
"classic" Mac software to the Mac OS X platform with
far less effort than a port to the entirely different Cocoa
system which originated in OpenStep.
What is Cocoa :
• Cocoa is Apple's native object-oriented application
programming interface (API) for the OS X operating
system.

• For iOS, there is a similar API called Cocoa Touch
which includes gesture recognition, animation, and a
different user interface library, and is for applications
for the iOS operating system, used on Apple devices
such as the iPhone, the iPod Touch, and the iPad.
Carbon and Cocoa User Interface
Communication :
Event Communication Between Carbon
& Cocoa :
Managing Core Foundation Objects
• Use similar memory allocation conventions
▫ Allocate , retain, release objects

• NSObject Class – reference counting schema for
memory managemnet
• Newelly allocate object
▫
▫
▫
▫

Created with alloc & copy – with retain count 1
Retain message – increment by one
Release message – decrement by one
Reaches zero – deallocated by a procedure
Main Difference of carbon & cocoa
• Cocoa has an Objective-C API, and can be accessed
from C and C++ code easily. Carbon is a pure-C API.

• Carbon had pre-Mac OS X applications. Cocoa has
evolved from the Next-Step framework that Apple
acquired and used as the basis to create Mac OS X.
It's the "native" API for Mac OS X and the only way
to access some of the newest capabilities.
Continue….
• One way to check if an application is carbon or not is
to open the package contents of the application ,if
inside the 'Contents' folder of the package there is a
folder called 'MacOSClassic' and one called 'MacOS',
then it is a Carbon application.
Conclusion
Through this discussion, got some information
related with Cocoa Framework over the Carbon
Framework which extends the functionality and
give the rich features.
References :
1. http://en.wikipedia.org/wiki/Cocoa_(API)
2. https://developer.apple.com/library/ios/docu
mentation/CoreFoundation/Conceptual/CFDe
signConcepts/Articles/tollFreeBridgedTypes.h
tml
3. https://developer.apple.com/library/mac/doc
umentation/cocoa/conceptual/memorymgmt/
MemoryMgmt.pdf
Thank You

Carbon vs cocoa

  • 1.
    Carbon vs Cocoa PreparedBy Kaushal S Malvi WiMC-13 131060753010
  • 2.
    Agenda • • • • • • Introduction of carbon Introductionof cocoa Carbon and Cocoa User Interface Communication Event Communication Between Carbon & Cocoa Main Difference of carbon & cocoa Reference
  • 3.
    What is Carbon: • Carbon is one of Apple Inc.'s C-based application programming interfaces (APIs) for the Macintosh operating system. • Carbon provides a good degree of backward compatibility for programs that ran on the now-obsolete Mac OS 8 and 9. • Developers could use the Carbon APIs to port their "classic" Mac software to the Mac OS X platform with far less effort than a port to the entirely different Cocoa system which originated in OpenStep.
  • 4.
    What is Cocoa: • Cocoa is Apple's native object-oriented application programming interface (API) for the OS X operating system. • For iOS, there is a similar API called Cocoa Touch which includes gesture recognition, animation, and a different user interface library, and is for applications for the iOS operating system, used on Apple devices such as the iPhone, the iPod Touch, and the iPad.
  • 5.
    Carbon and CocoaUser Interface Communication :
  • 6.
  • 7.
    Managing Core FoundationObjects • Use similar memory allocation conventions ▫ Allocate , retain, release objects • NSObject Class – reference counting schema for memory managemnet • Newelly allocate object ▫ ▫ ▫ ▫ Created with alloc & copy – with retain count 1 Retain message – increment by one Release message – decrement by one Reaches zero – deallocated by a procedure
  • 8.
    Main Difference ofcarbon & cocoa • Cocoa has an Objective-C API, and can be accessed from C and C++ code easily. Carbon is a pure-C API. • Carbon had pre-Mac OS X applications. Cocoa has evolved from the Next-Step framework that Apple acquired and used as the basis to create Mac OS X. It's the "native" API for Mac OS X and the only way to access some of the newest capabilities.
  • 9.
    Continue…. • One wayto check if an application is carbon or not is to open the package contents of the application ,if inside the 'Contents' folder of the package there is a folder called 'MacOSClassic' and one called 'MacOS', then it is a Carbon application.
  • 10.
    Conclusion Through this discussion,got some information related with Cocoa Framework over the Carbon Framework which extends the functionality and give the rich features.
  • 11.
    References : 1. http://en.wikipedia.org/wiki/Cocoa_(API) 2.https://developer.apple.com/library/ios/docu mentation/CoreFoundation/Conceptual/CFDe signConcepts/Articles/tollFreeBridgedTypes.h tml 3. https://developer.apple.com/library/mac/doc umentation/cocoa/conceptual/memorymgmt/ MemoryMgmt.pdf
  • 12.