Cocoa Programming For Mac Os X For Dummies Pdf

Download Advanced Mac Os X Programming ebook PDF or Read Online books in PDF. Cocoa Programming For Mac Os X For Dummies. Author: Erick Tejkowski ISBN.

Cocoa Programming For Mac Os X For Dummies Pdf

This book aims to provide beginners with an introduction to the programming of Mac OS X Apps using Cocoa, and XCode, the free developer tools provided by Apple, Inc. Examples of Mac apps are: iTunes, Safari, Mail, iCal, Address Book, Microsoft Word, Microsoft Excel, etc. Using Objective-C, Cocoa and XCode as taught in this wikibook will start your education in how to develop Mac apps.

Many of the skills that you learn in this wikibook can be used to build apps for iOS but there are some differences between Mac OS X apps and iOS apps. This book focuses on Mac OS X apps.

Some knowledge of another programming language, preferably Objective-C. The following link is a link to a wikibook that covers Objective C Programming.

Apple has a Mac App Store where it can sell your Mac apps for you and they will pay you 70% of the proceeds. The Mac App Store is available for users of Mac OS X, 10.6 and later by choosing from the Apple menu 'App Store...'.

In general, this text is written to be followed in order from start to finish except that if you have experience in C, C++, Java or Python, you are encouraged to look at the relevant section of the Appendix to orient you to developing for Mac OS X and Cocoa.

As each topic develops, it builds on the code written previously to add complexity and functionality, so you are advised to read this wikibook from start to finish in the order that it was written.

Contents

What Is Cocoa?

Building a Simple Mac App

Building Blocks of Mac OS X Apps

  • Frameworks

Building More Complex Mac Apps

More About the Cocoa Framework

Cocoa Programming For Mac Os X Pdf

Model-View-Controller (MVC) Design Pattern

  • The View
    • Custom Views

More Cocoa Classes

Other Application Types

Managing Source Code

Mac Os X Versions

The Wikidraw App

  • Implementing Wikidraw

Where to Go Next

Appendix

Cocoa Programming For Mac Os X For Dummies Pdf Download


Cocoa Programming For Mac Os X For Dummies Pdf Converter

Retrieved from 'https://en.wikibooks.org/w/index.php?title=Programming_Mac_OS_X_with_Cocoa_for_Beginners_2nd_Edition&oldid=3470433'

Cocoa Programming For Mac Os X For Dummies Pdf File

Reference Materials‎ > ‎

Cocoa Programming for Mac OS X

Buy it at Amazon

Hillegass, Aaron

May 15, 2008

464 Pages


Many folks refer to this as the 'bible' for learning Cocoa. As CoachCorso would say, 'Not so fast, my friend!' While this is, indeed, anoutstanding tome, it is not for the faint of heart (or the new Cocoauser). In other words, don't start here. Start here or here.

I liked this book, although, to be honest, by the time I got to theend I was just typing the examples in without understanding what theywere really doing. The author assumes a certain degree of prerequisteknowledge, and he moves ahead pretty fast. Better bone up on yourObjective-C before tackling this one.

  1. Chapter 1: Cocoa: What is it?
    • A Little History, Tools, Xcode, Interface Builder, gcc, gdb, Language, Objects, Classes, Methods, and Messages, Instance Variables, Pointers, Frameworks, Foundation Framework, AppKit Framework, Core Data, How to Read This Book, Typographical Conventions, Common Mistakes, How to Learn
  2. Chapter 2: Let's Get Started
    • In Xcode, Create a New Project, Application, Tool, Bundle or Framework, The main() Function, main(), NSApplicationMain(), Nib file, In Interface Builder, The Library Window, The Blank Window, NSWindow, Lay Out the Interface, The Inspector, The Doc Window, First Responder, File's Owner, NSApplication, Create a Class, Header file (interface file), Implementation file, Outlets, Actions, NSTextField, Create an Instance, Make Connections, NSTextField, Back in Xcode, Types and Constants in Objective-C, id, BOOL, YES, NO, IBOutlet, IBAction, nil, Look at the Header File, #import, #include, @interface, Edit the Implementation File, random(), srandom(), Build and Run, awakFromNib, NSCalendarDate, Documentation, What Have You Done?, Main event loop, terminate:
  3. Chapter 3: Objective-C
    • Creating and Using Instances, NSMutableArray, alloc, Pointers, init, Arguments, selector, addObject:, insertObject: atIndex:, NSNumber, Using Existing Classes, main(), NSAutoreleaePool, NSMutableArray, NSNumber, NSLog, printf(), Format string, description, NSString, stringWithUTF8String:, UTF8String:, Sending Messages to nil, NSObject, NSArray, NSMutableArray, and NSString, NSObject, init, alloc, description, isEqual:, NSArray, Immutable, count, objectAtIndex:, containsObject:, indexOfObject:, NSNotFound, NSMutableArray, mutableCopy, addObject:, addObjectsFromArray:, insertObject: atIndex:, removeAllObjects:, removeObject:, removeObjectAtIndex:, NSNull, null, NSString, initWithFormat:, sprintf(), length, stringByAppendingString:, 'Inherits from' versus 'Uses' or 'Knows about', Composition, Creating Your Own Classes, Creating the LotteryEntry Class, LotteryEntry.h, Accessor methods, LotteryEntry.m, random, Changing Lottery.m, NSCalendarDate, srandom(), Implementing a Description Method, initWithFormat:, descriptionWithCalendarFormat:, NSCalendarDate, calendarDate, Class method, timeZoneWithName:, dateWithYear: month: day: hour: minute: second: timeZone:, dateByAddingYears: months: days: hours: minutes: seconds:, dayOfCommonEra, dayOfMonth, dayOfWeek, dayOfYear, hourOfDay, minuteOfHour, monthOfYear, setCalendarFormat:, laterDate:, NSTimeInterval, timeIntervalSinceDate:, Writing Initializers, init, super, self, Initializers with Arguments, Designated initializer, The Debugger, Breakpoints, Print-object 'po', Exceptions, Symbolic breakpoints, NSAssert(), NS_Block_Assertions, NSCAssert(), For the More Curious: How Does Messaging Work?, isa, SEL, NSBundle, Challenge
  4. Chapter 4: Memory Management
    • Retain counts, Garbage collector, Retain cycle, Turning the Garbage Collector On and Off, Living With the Garbage Collector, NSGarbageCollector, defaultCollector, Living With Retain Counts, alloc, retain, release, Implementing dealloc, Creating Autoreleased Objects, alloc, release, NSAutoreleasePool, autorelease, Temporary Objects, Accessor Methods, What Have You Done?
  5. Chapter 5: Target/Action
    • NSControl, NSButton, NSSlider, NSTextView, NSColorWell, Target, Action, sender, NSView, NSResponder, mouseDown:, keyDown:, Some Commonly Used Subclasses of NSControl, NSButton, NSSlider, NSTextField, NSButton, setEnabled:, state, NSOnState, NSOffState, setState:, NSSlider, setFloatValue:, floatValue:, NSTextField, NSSecureTextField, stringValue:, setStringValue:, objectValue:, setObjectValue:, NSFormatter, NSCalendarDate, NSDateFormatter, Start the SpeakLine Example, Lay Out the Nib File, Making Connections in Interface Builder, NSWindow's initialFirstResponder Outlet, initialFirstResponder, Implementing the AppController Class, NSSpeechSynthesizer, initWithVoice:, startSpeakingString:, stopSpeaking, NSMenuItem, For the More Curious: Setting the Target Programmatically, setAction:, @selector, NSSelectorFromString():, Challenge, stringValue, setStringValue:, length, stringWithFormat:, Debugging Hints, NSZombiesEnabled, CFZombieLevel
  6. Chapter 6: Helper Objects
    1. Delegates
    2. NSSpeechSynthesizer
    3. speechSynthesizer: didFinishSpeaking:
    4. speechSynthesizer: willSpeakWord: ofString:
    5. speechSynthesizer: willSpeakPhoneme:
    6. NSButton
    7. setEnabled:
    8. The NSTableView and Its dataSource
    9. NSTableDataSource informal protocol
    10. numberOfRowsInTableView:
    11. tableView: objectValueForTableColumn: row:
    12. tableView: setObjectValue: forTableColumn: row:
    13. reloadData
    14. availableVoices
    15. Lay Out the User Interface
    16. Make Connections
    17. Edit AppController.m
    18. tableViewSelectionDidChange:
    19. awakeFromNib
    20. Common Errors in Implementing a Delegate
    21. Object Delegates
    22. For the More Curious: How Delegates Work
    23. respondsToSelector:
    24. Challenge: Make a Delegate
    25. Challenge: Make a Data Source
    26. replaceObjectAtIndex: withObject:
Chapter 7: Key-Value Coding; Key-Value Observing
    • Key
    • setValueForKey:
    • valueForKey:
  • Key-Value Coding
    • NSNumber
  • Bindings
  • Key-Value Observing
  • Making Keys Observable
    • willChangeValueForKey:
    • didChangeValueForKey:
  • Properties and Their Attributes
    • Dot notation
  • @property and @synthesize
  • Attributes of a Property
    • readwrite
    • readonly
    • assign
    • retain
    • copy
    • nonatomic
  • For the More Curious: Key Paths
    • @avg
    • @count
    • @max
    • @min
    • @sum
  • For the More Curious: Key-Value Observing
Chapter 8: NSArrayController
    • Model-View-Controller
    • NSController
    • NSObjectController
    • NSArrayController
  • Starting the RaiseMan Application
  • In Xcode
    • NSDocument
  • In Interface Builder
  • Key-Value Coding and nil
    • NSNumber
    • setValue: forKey:
    • NSDecimalNumber
    • setNilValueForKey:
  • Add Sorting
    • compare:
    • caseInsensitiveCompare:
    • NSComparisonResult
    • NSOrderedAscending
    • NSOrderedSame
    • NSOrderedDescending
  • For the More Curious: Sorting Without NSArrayController
    • NSSortDescriptor
    • sortUsingDescriptors:
    • tableView: sortDescriptorDidChange:
  • Challenge 1
  • Challenge 2
Chapter 9: NSUndoManager
  • NSInvocation
    • forwardInvocation:
  • How the NSUndoManager Works
    • prepareWithInvocationTarget:
    • setActionName:
  • Adding Undo to RaiseMan
  • Key-Value Observing
    • addObserver: forKeyPath: options: context:
    • observeValueForKeyPath: ofObject: change: context:
  • Undo for Edits
    • changeKeyPath: ofObject: toValue:
  • Begin Editing on Insert
  • For the More Curious: Windows and the Undo Manager
    • NSTextView
    • undoManagerForTextView:
    • undoManager
    • windowWillReturnUndoManager:
Chapter 10: Archiving
    • Archive
    • Unarchive
    • Protocol
  • NSCoder and NSCoding
    • initWithCoder:
    • encodeWithCoder:
    • Abstract class
    • NSKeyedArchiver
    • NSKeyedUnarchiver
  • Encoding
    • encodeObject: forKey:
    • encodeBool: forKey:
    • encodeDouble: forKey:
    • encodeFloat: forKey:
    • encodeInt: forKey:
  • Decoding
    • decodeObjectForKey:
    • decodeBoolForKey:
    • decodeDoubleForKey:
    • decodeFloatForKey:
    • decodeIntForKey:
  • The Document Architecture
    • NSDocumentController
    • NSDocument
    • NSWindowController
  • Info.plist and NSDocumentController
  • NSDocument
    • NSDocumentController
    • NSWindowController
  • Saving
    • File wrapper
    • dataOfType: error:
    • NSData
    • NSError
    • fileWrapperOfType: error:
    • NSFileWrapper
    • writeToURL: ofType: error:
  • Loading
    • readFromData: ofType: error:
    • readFromFileWrapper: ofType: error:
    • readFromURL: ofType: error:
    • windowControllerDidLoadNib:
  • NSWindowController
  • Saving and NSKeyedArchiver
    • NSData
    • NSKeyedArchiver
    • archivedDataWithRootObject:
  • Loading and NSKeyedUnarchiver
    • unarchiveObjectWithData:
  • Setting the Extension and Icon for the File Type
  • For the More Curious: Preventing Infinite Loops
    • NSCoder
    • encodeConditionalObject: forKey:
  • For the More Curious: Creating a Protocol
    • @protocol
    • @optional
  • For the More Curious: Document-Based Applications Without Undo
    • updateChangeCount:
    • NSDocumentChangeType
    • NSChangeDone
    • NSChangeUndone
    • NSChangeCleared
  • Universal Type Identifiers
    • UTExportedType Declarations
Chapter 11: Basic Core Data
    • NSArrayController
    • Bindings
    • NSManagedObjectContext
  • NSManagedObjectModel
    • Entity
    • Property
    • Attributes
    • Relationships
    • NSPersistentDocument
  • Interface
  • Create and Configure Views
    • NSDatePicker
    • NSImageView
    • NSLevelIndicator
  • Connections and Binding
  • How Core Data Works
    • NSPersistentDocument
    • NSManagedObjectModel
    • NSEntityDescription
    • NSAttributeDescription
    • NSPersistentStoreCoordinator
    • NSManagedObjectContext
    • NSManagedObject
    • NSUndoManager
    • NSArrayController
Chapter 12: Nib Files and NSWindowController
    • NSApplication
  • NSPanel
    • NSWindow
  • Adding a Panel to the Application
    • NSWindowController
    • @class
  • Setting Up the Menu Item
  • AppController.m
    • NSWindowController
  • Preferences.nib
    • Xib files
    • Nib files
  • File's Owner
  • Lay Out the User Interface
  • PreferenceController.m
    • windowDidLoad:
    • awakeFromNib
    • windowControllerDidLoadNib:
    • showWindow:
    • NSWindowController
  • For the More Curious: NSBundle
    • Bundle
    • mainBundle
    • bundleWithPath:
    • pathForImageResource:
    • initWithContentsOfFile:
    • classNamed:
    • principalClass
    • loadNibNamed: owner:
  • Challenge
Chapter 13: User Defaults
    • NSUserDefaults
  • NSDictionary and NSMutableDictionary
    • Dictionary
    • Key-value pairs
    • objectForKey:
  • NSDictionary
    • allKeys
    • count
    • objectForKey:
    • keyEnumerator
    • objectEnumerator
  • NSMutableDictionary
    • dictionary
    • removeObjectForKey:
    • setObject: forKey:
  • NSUserDefaults
    • Registering defaults
    • Reading and using the defaults
    • Setting the defaults
    • standardUserDefaults
    • registerDefaults:
    • setBool: forKey:
    • setFloat: forKey:
    • setInteger: forKey:
    • setObject: forKey:
    • boolForKey:
    • floatForKey:
    • integerForKey:
    • objectForKey:
    • removeObjectForKey:
  • Precedence of Different Types of Defaults
    • Domains
    • Arguments
    • Application
    • Global
    • Language
    • Registered defaults
  • Setting the Identifier for the Application
  • Creating Kays for the Names of the Defaults
    • #import
    • #define
    • Global variables
    • extern
    • const
  • Registering Defaults
    • intiialize
    • NSColor
    • NSString
    • NSArray
    • NSDictionary
    • NSCalendarDate
    • NSData
    • NSNumber
  • Letting the User Edit the Defauts
    • windowDidLoad:
  • Using the Defaults
    • NSApplication
  • Suppressing the Creating of Untitled Documents
    • NSApplication
    • applicationShouldOpenUntitledFile:
  • Setting the Background Color on the Table View
    • windowControllerDidLoadNib:
  • For the More Curious: NSUserDefaultsController
    • NSUserDefaults
  • For the More Curious: Reading and Writing Defaults from the Command Line
    • defaults tool
    • NSOpenPanel
  • Challenge
Chapter 14: Using Notifications
  • What Notifications Are
    • NSNotificationCenter
    • Observers
    • Notifications
    • Posters
  • What Notifications Are Not
  • NSNotification and NSNotificationCenter
    • name
    • object
    • defaultCenter
    • addObserver: selector: name: object:
    • postNotification:
    • postNotificationName: object:
    • removeObserver:
  • Posting a Notification
    • extern
    • const
  • Registering as an Observer
  • Handling the Notification When it Arrives
  • The userInfo Dictionary
    • userInfo
    • NSDictionary
  • For the More Curious: Delegates and Notifications
  • Challenge
Chapter 15: Using Alert Panels
    • NSRunAlertPanel()
    • NSAlertDefaultReturn
    • NSAlertAlternateReturn
    • NSAlertOtherReturn
    • Modal
    • Sheets
  • Make the User Confirm the Deletion
    • NSAlert
    • alertWithMessageText: defaultButton: alternateButton: otherButton: informativeTextWithFormat:
    • beginSheetModalForWindow: modalDelegate: didEndSelector: contextInfo:
    • alertEnded: code: context:
  • Challenge
Chapter 16: Localization
    • NSBundle
  • Localizing a Nib File
  • String Tables
    • Key-value pairs
    • NSBundle
    • localizedStringForKey: value: table:
  • Creating String Tables
  • Using the String Table
    • genstrings
    • NSLocalizedString
  • For the More Curious: ibtool
  • For the More Curious: Explicit Ordering of Tokens in Format Strings
Chapter 17: Custom Views
    • NSView
    • NSwindow
  • The View Hierarchy
    • superview
    • subviews
    • window
    • NSBox
    • NSScrollView
    • NSSplitView
    • NSTabView
  • Getting a View to Draw Itself
  • Create an Instance of a View Subclass
  • Size Inspector
  • drawRect:
    • setNeedsDisplay:
    • NSBezierPath
    • NSImage
    • bounds
    • NSColor
    • set
    • fillRect:
    • NSPoint
    • NSSize
    • NSRect
    • NSRange
    • NSDecimal
    • NSAffineTrasformStruct
    • setNeedsDisplayInRect:
  • Drawing With NSBezierPath
    • NSPoint
    • initWithFrame:
    • stroke
    • fill
  • NSScrollView
    • Document view
    • Content view
    • Scroll bars
  • Creating Views Programmatically
    • contentView
    • addSubview:
  • For the More Curious: Cells
    • NSControl
    • NSButton
    • NSMatrix
    • NSButtonCell
    • NSSlider
    • NSSliderCell
    • NSTextField
    • NSTextFieldCell
    • NSColorWell
  • For the More Curious: isFlipped
    • Points
  • Challenge
Chapter 18: Images and Mouse Events
  • NSResponder
    • mouseDown:
    • rightMouseDown:
    • otherMouseDown:
    • mouseUp:
    • rightMouseUp:
    • otherMouseUp:
    • mouseDragged:
    • scrollWheel:
    • rightMouseDragged:
    • otherMouseDragged:
    • NSEvent
  • NSEvent
    • locationInWindow
    • modifierFlags
    • NSControlKeyMask
    • NSShiftKeyMask
    • NSAlternateKeyMask
    • NSCommandKeyMask
    • timestamp
    • window
    • clickCount
    • presure
    • deltaX
    • deltaY
    • deltaZ
  • Getting Mouse Events
    • #pragma mark
  • Using NSOpenPanel
  • Change the Nib File
  • Edit the Code
    • NSOKButton
    • beginSheetForDirectory: file: types: modalForWindow: modalDelegate: didEndSelector: contextInfo:
    • openPanelDidEnd: returnCode: contextInfo:
  • Composite an Image onto Your View
    • drawInRect: fromRect: operation: fraction:
  • The View's Coordinate System
    • NSPoint
    • convertPoint: fromView:
  • Autoscrolling
    • autoscroll:
  • For the More Curious: NSImage
    • NSImageRep
    • NSBitmapImageRep
    • NSEPSImageRep
    • NSPictImageRep
    • NSCachedImageRep
    • NSCustomImageRep
    • NSPDFImageRep
  • Challenge
    • NSBezierPath
    • bezierPathWithOvalInRect:
Chapter 19: Keyboard Events
  • Key window, firstResponder, NSResponder, acceptsFirstResponder, resignFirstResponder, becomeFirstResponder, keyDown:, keyUp:, flagsChanged:, NSEvent, characters, isARepeat, keyCode, modifierFlags, Create a New Project with a Custom View, Lay Out the Interface, Make Connections, nextKeyView, initialFirstResponder, Write the Code, keyboardFocusIndicatorColor, interpretKeyEvents:, For the More Curious: Rollovers, mouseMoved:, mouseEntered:, mouseExited:, setAcceptsMouseMovedEvents:, viewDidMoveToWindow:, NSTrackingInVisibleRect, The Fuzzy Blue Box
Chapter 20: Drawing Text with Attributes
  • NSFont, fontWithName: size:, userFixedPitchFontOfSize:, userFontOfSize:, messageFontOfSize:, toolTipFontOfSize:, titleBarFontOfSize:, NSAttributedString, NSRange, NSMakeRange(), NSAttributedString, addAttribute: value: range:, setAttributedStringValue:, setAttributedTitle:, NSFontAttributeName, NSForegroundColorAttributeName, NSParagraphStyleAttributeName, NSUnderlineColorAttributeName, NSSuperscriptAttributeName, NSShadowAttributeName, NSData, Webview, Drawing Strings and Attributed Strings, drawAtPoint:, drawInRect:, size, drawAtPoint: withAttributes:, drawInRect: withAttributes:, sizeWithAttributes:, Making Letters Appear, Getting Your View to Generate PDF Data, NSView, dataWithPDFInsideRect:, NSInputManager, For the More Curious: NSFontManager, convertFont: toHaveTrait:, Challenge 1, NSShadow, init, setShadowOffset:, setShadowBlurRadius:, setShadowColor:, Challenge 2
Chapter 21: Pasteboards and Nil-Targeted Actions
  • NSPasteboard, generalPasteboard, pasteboardWithName:, declareTypes: owner:, setData: forType:, setString: forType:, types, availableTypeFromArray:, dataForType:, stringForType:, Add Cut, Copy, and Paste to BigLetterView, Nil-Targeted Actions, nextResponder, Responder chain, How the Responder Chain is Searched, Looking at the Nib File, First Responder, For the More Curious: Which Object Sends the Action Message?, NSApplication, sendAction: to: from:, For the More Curious: Lazy Copying, declareTypes: owner:, pasteboard: provideDataForType:, pasteboardChangedOwner:, Challenge 1, Challenge 2
Chapter 22: Categories
  • Add a Method to NSString, NSRange, For the More Curious: Declaring Private Methods, For the More Curious: Declaring Informal Protocols, @optional
Chapter 23: Drag-and-Drop
  • Make BigLetterView a Drag Source, draggingSourceOperationMaskForLocal:, NSView, dragImage: at: offset: event: pasteboard: source: slideBack:, draggedImage: endedAt: operation:, Make BigLetterView a Drag Destination, NSView, registerForDraggedTypes:, draggingEntered:, draggingUpdated:, draggingExited:, prepareForDragOperation:, performDragOperation:, concludeDragOperation:, registerForDraggedTypes, Add Highlighting, NSGradient, Implement the Dragging-Destination Methods, NSDraggingInfo, Test, For the More Curious: Operation Mask
Chapter 24: NSTimer
  • NSButton, NSProgressIndicator, Lay Out the Interface, NSProgressIndicator, Make Connections, Adding Code to AppController, For the More Curious: NSRunLoop, NSApplication, NSTimer, Challenge
Chapter 25: Sheets
  • NSWindow, NSApplication, beginSheet: modalForWindow: modalDelegate: didEndSelector: contextInfo:, endSheet: returnCode:, Adding a Sheet, Add Outlets and Actions, Lay Out the Interface, Add Code, For the More Curious: contextInfo, For the More Curious: Modal Windows, runModalForWindow:, stopModalWithCode:
Chapter 26: Working with NSTextView
Chapter 27: Creating Interface Builder Palettes
Chapter 28: AppleScript
Chapter 29: Cocoa and OpenGL
Chapter 30: Creating Frameworks
Chapter 31: GNUstep
Chapter 32: The End