Appkit framework is needed for implementing graphical, event -driven user interface in OSX like window, buttons, panels, menus, scroller, text field, table views etc.
The root of the Appkit framework is the NSResponder class.
Appkit is divided primarily into these areas:
Text and Fonts – NSFont, NSFontManager.
Graphics and Colors – NSImage, NSColor, NSColorPanel. NSColorWell, NSGraphicsContext, NSBezierPath etc.
Printing and Faxing (NSPrinter, NSPrintPanel, NSPageLayout, NSPrintInfo).
Document and File System Support NSFileWrapper, NSFileManager.
Sharing Data with other applications – NSPasteBoard.
Drag & Drop.
Spell Check – NSSpellServer.
Cocoa has 3 core frameworks:
Instruments : Instruments can be used to show the following
Shark: Traces function calls and graphs memory allocation.
Big Top: Graphs performance trends.
Spin Control: Gathers information about what the application was doing when the rainbow spinner appeared.
Malloc Debug: Shows how much memory the application is consuming and which functions allocated large amounts of memory. Also helps find leaks by finding allocated memory that is not referenced anywhere in the program.
Quartz Debug: helps debug applications that do large amounts of drawing and imaging.
XCode is the engine that powers Apple’s integrated development environment (IDE) for OSX and iOS.
Using XCode developers can:
Interface builder is a graphical tool for creating user interfaces.
Has the following design element:
There are two main frameworks required for building Cocoa Applications:
NSNumber: Can instantiate object that contains integers, floats or doubles.
NSDate: For storing streams of bytes, writing data objects to the file system and reading from them.
NSDate: Displaying dates, times in many formats. Time adjustments based on time zones.
NSString: Different representation of character strings such as UTF-8 etc.
NSAttributedString: Supports strings with attributes such as font etc.
NSArray: Ordered collection of objects, uses zero based indexing.
NSDictionary: Managing key value pairs, Dictionaries are unordered and must contain unique keys.
NSSet: Similar to NSArray but unsorted. Contains distinct objects.
NSFileManager: Used for file operations.
NSThread: Used for creating multithreaded programs.
NSOperation & NSOperationQueue : To perform multiple operations (concurrent & Non-Concurrent) in priority and dependence order.
NSXMLParser: To process XML Data.
NSXML: Used to represent a XML document as a hierarchical tree.
Foundation (Foundation. Framework):
Application Kit (AppKit.Framework):
The Mac OSX is layered into the following:
Graphics and Media (Application Services):
The Foundation framework defines a base layer of classes that can be used for any type of Cocoa program.
Foundation framework is designed for:
The Foundation Framework is logically grouped into Categories.
Operation System Services:
Archiving and Serialization
XML Processing – NSXML
Predicates and Expressions – NSPredicate, NSCompoundPredicate, NSComparisonPredicate.
Spotlight Queries NSMetadataItem. NSMetadataQuery.
The root class does not inherit from any other class and all other classes inherit from the root class.
The root class primarily accesses and interacts with the objective C runtime.
Cocoa has two root classes:
Event Driven Behavior – Cocoa provides the infrastructure for event driven behavior.
It helps manage application, windows and workspaces
Has a rich library of user interface objects available in Interface builder. UI Objects can be dragged dropped from the interface builder or can be created from code. Some sample UI objects are (buttons, tables, views, windows, panels, drawers, segmented control etc).
Supports the following: