Cocoa Programming for Mac OS X

Cocoa Programming for Mac OS X

3.99 (531 ratings by Goodreads)
By (author)  , By (author) 

List price: US$49.99

Currently unavailable

Add to wishlist

AbeBooks may have this title (opens in new window).

Try AbeBooks

Description

The best-selling introduction to Cocoa, once again updated to cover the latest Mac programming technologies, and still enthusiastically recommended by experienced Mac OS X developers. "Cocoa (R) Programming for Mac (R) OS X is considered by most to be the de-facto intro-to-OS X programming text."-Bob Rudis, the Apple Blog "I would highly recommend this title to anyone interested in Mac development. Even if you own the previous edition, I think you'll find the new and revised content well worth the price."-Bob McCune, bobmccune.com If you're developing applications for Mac OS X, Cocoa (R) Programming for Mac (R) OS X, Fourth Edition, is the book you've been waiting to get your hands on. If you're new to the Mac environment, it's probably the book you've been told to read first. Covering the bulk of what you need to know to develop full-featured applications for OS X, written in an engaging tutorial style, and thoroughly class-tested to assure clarity and accuracy, it is an invaluable resource for any Mac programmer. Specifically, Aaron Hillegass and Adam Preble introduce the two most commonly used Mac developer tools: Xcode and Instruments. They also cover the Objective-C language and the major design patterns of Cocoa. Aaron and Adam illustrate their explanations with exemplary code, written in the idioms of the Cocoa community, to show you how Mac programs should be written. After reading this book, you will know enough to understand and utilize Apple's online documentation for your own unique needs. And you will know enough to write your own stylish code. Updated for Mac OS X 10.6 and 10.7, this fourth edition includes coverage of Xcode 4, blocks, view-based table views, Apple's new approach to memory management (Automatic Reference Counting), and the Mac App Store. This edition adds a new chapter on concurrency and expands coverage of Core Animation. The book now devotes a full chapter to the basics of iOS development.
show more

Product details

  • Paperback | 528 pages
  • 178 x 230 x 34mm | 821g
  • Pearson Education (US)
  • Addison-Wesley Educational Publishers Inc
  • New Jersey, United States
  • English
  • 4th edition
  • 0321774086
  • 9780321774088
  • 273,690

About Aaron Hillegass

Aaron Hillegass, who worked at NeXT and Apple, now teaches popular Cocoa programming classes at Big Nerd Ranch. At NeXT, he wrote the first course on OpenStep, the predecessor to today's Cocoa tools. This book is based on the big Nerd Ranch course and is influenced by more than a decade of work with OpenStep and Cocoa. Adam Preble learned Cocoa programming from the first edition of this book. After too many years of professional C/C++ development, today Adam writes Mac and iOS applications at Big Nerd Ranch, where he is also a Cocoa instructor. He is frequently filling in the gaps between work and family time with pinball machine software development and countless other projects.
show more

Table of contents

Preface xixAcknowledgments xxi Chapter 1: Cocoa: What Is It? 1A Little History 1Tools 3Language 4Objects, Classes, Methods, and Messages 5Frameworks 6How to Read This Book 7Typographical Conventions 7Common Mistakes 8How to Learn 8 Chapter 2: Let's Get Started 11In Xcode 11In Interface Builder 15A Look at Objective-C 25Documentation 31What Have You Done? 31Chronology of an Application 32 Chapter 3: Objective-C 35Creating and Using Instances 35Using Existing Classes 37Creating Your Own Classes 48The Debugger 58What Have You Done? 63Meet the Static Analyzer 63For the More Curious: How Does Messaging Work? 65Challenge 66 Chapter 4: Memory Management 67Living with Manual Reference Counting 69Accessor Methods 77Living with ARC 80 Chapter 5: Target/Action 83Some Commonly Used Subclasses of NSControl 85Start the SpeakLine Example 89Lay Out the XIB File 90Implementing the SpeakLineAppDelegate Class 94For the More Curious: Setting the Target Programmatically 96Challenge 96Debugging Hints 98 Chapter 6: Helper Objects 99Delegates 100The NSTableView and Its dataSource 104Lay Out the User Interface 107Make Connections 109Edit SpeakLineAppDelegate.m 110For the More Curious: How Delegates Work 113Challenge: Make a Delegate 114Challenge: Make a Data Source 114 Chapter 7: Key-Value Coding and Key-Value Observing 117Key-Value Coding 117Bindings 119Key-Value Observing 120Making Keys Observable 121Properties 124For the More Curious: Key Paths 126For the More Curious: Key-Value Observing 127 Chapter 8: NSArrayController 129Starting the RaiseMan Application 130Key-Value Coding and nil 139Add Sorting 140For the More Curious: Sorting without NSArrayController 141Challenge 1 142Challenge 2 142 Chapter 9: NSUndoManager 145NSInvocation 145How the NSUndoManager Works 146Adding Undo to RaiseMan 148Key-Value Observing 152Undo for Edits 153Begin Editing on Insert 156For the More Curious: Windows and the Undo Manager 158 Chapter 10: Archiving 159NSCoder and NSCoding 160The Document Architecture 163Saving and NSKeyedArchiver 167Loading and NSKeyedUnarchiver 168Setting the Extension and Icon for the File Type 170For the More Curious: Preventing Infinite Loops 172For the More Curious: Creating a Protocol 173For the More Curious: Automatic Document Saving 174For the More Curious: Document-Based Applications without Undo 175Universal Type Identifiers 175 Chapter 11: Basic Core Data 177NSManagedObjectModel 177Interface 179For the More Curious: View-Based versus Cell-Based Table Views 191Challenge 191 Chapter 12: NIB Files and NSWindowController 193NSPanel 193Adding a Panel to the Application 194For the More Curious: NSBundle 204Challenge 206 Chapter 13: User Defaults 207NSDictionary and NSMutableDictionary 208NSUserDefaults 210Setting Defaults 212Letting the User Edit the Defaults 213Using the Defaults 215For the More Curious: NSUserDefaultsController 217For the More Curious: Reading and Writing Defaults from the Command Line 217Challenge 219 Chapter 14: Using Notifications 221What Notifications Are and Are Not 221What Notifications Are Not 222NSNotification 222NSNotificationCenter 222Posting a Notification 224Registering as an Observer 225Handling the Notification When It Arrives 226The userInfo Dictionary 226For the More Curious: Delegates and Notifications 227Challenge 228 Chapter 15: Using Alert Panels 229Make the User Confirm the Deletion 230Challenge 232 Chapter 16: Localization 233Localizing a NIB File 234String Tables 236For the More Curious: ibtool 239For the More Curious: Explicit Ordering of Tokens in Format Strings 240 Chapter 17: Custom Views 241The View Hierarchy 241Get a View to Draw Itself 243Drawing with NSBezierPath 248NSScrollView 250Creating Views Programmatically 252For the More Curious: Cells 253For the More Curious: isFlipped 255Challenge 255 Chapter 18: Images and Mouse Events 257NSResponder 257NSEvent 257Getting Mouse Events 259Using NSOpenPanel 259Composite an Image onto Your View 264The View's Coordinate System 266Autoscrolling 268For the More Curious: NSImage 269Challenge 270 Chapter 19: Keyboard Events 271NSResponder 273NSEvent 273Create a New Project with a Custom View 274For the More Curious: Rollovers 282The Fuzzy Blue Box 284 Chapter 20: Drawing Text with Attributes 285NSFont 285NSAttributedString 286Drawing Strings and Attributed Strings 289Making Letters Appear 289Getting Your View to Generate PDF Data 291For the More Curious: NSFontManager 293Challenge 1 293Challenge 2 294 Chapter 21: Pasteboards and Nil-Targeted Actions 295NSPasteboard 296Add Cut, Copy, and Paste to BigLetterView 298Nil-Targeted Actions 300For the More Curious: Which Object Sends the Action Message? 303For the More Curious: UTIs and the Pasteboard 303For the More Curious: Lazy Copying 304Challenge 1 305Challenge 2 305 Chapter 22: Categories 307Add a Method to NSString 307For the More Curious: Declaring Private Methods 309 Chapter 23: Drag-and-Drop 311Make BigLetterView a Drag Source 312Make BigLetterView a Drag Destination 315For the More Curious: Operation Mask 319 Chapter 24: NSTimer 321Lay Out the Interface 323Make Connections 325Add Code to TutorController 326For the More Curious: NSRunLoop 328Challenge 328 Chapter 25: Sheets 329Adding a Sheet 330For the More Curious: contextInfo 335For the More Curious: Modal Windows 336 Chapter 26: Creating NSFormatters 339A Basic Formatter 341The Delegate of the NSControl Class 347Checking Partial Strings 348Formatters That Return Attributed Strings 350For the More Curious: NSValueTransformer 351 Chapter 27: Printing 353Dealing with Pagination 353For the More Curious: Are You Drawing to the Screen? 358Challenge 358 Chapter 28: Web Services 359RanchForecast Project 360Opening URLs 368Challenge: Add a WebView 369 Chapter 29: Blocks 371Block Syntax 373Challenge: Design a Delegate 381 Chapter 30: Developing for iOS 383Porting RanchForecast to iOS 383RootViewController 386Add a Navigation Controller 388ScheduleViewController 391UITableViewController 392Pushing View Controllers 393Challenge 395 Chapter 31: View Swapping 397Get Started 398Add View Swapping to MyDocument 401Resizing the Window 403 Chapter 32: Core Data Relationships 407Edit the Model 407Create Custom NSManagedObject Classes 409Lay Out the Interface 411EmployeeView.xib 413Events and nextResponder 414 Chapter 33: Core Animation 417Scattered 417Implicit Animation and Actions 423Challenge 1 425Challenge 2 425 Chapter 34: Concurrency 427Multithreading 427Improving Scattered: Time Profiling in Instruments 431NSOperationQueue 435For the More Curious: Faster Scattered 438Challenge 439 Chapter 35: Cocoa and OpenGL 441A Simple Cocoa/OpenGL Application 442 Chapter 36: NSTask 451ZIPspector 451Challenge: .tar and .tgz files 460 Chapter 37: Distributing Your App 461Build Configurations 461Creating a Release Build 464Application Sandboxing 466The Mac App Store 468 Chapter 38: The End 471 Index 473
show more

Rating details

531 ratings
3.99 out of 5 stars
5 33% (173)
4 42% (222)
3 20% (106)
2 4% (22)
1 2% (8)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X