Free Download Cocoa Programming For Mac
Sep 08, 2015 Cocoa Programming for OS X, 5th Edition. This branch contains solutions and the companion guide for Swift 2.0. If you are using Swift 1.2, see the swift1-2 branch. Solutions and Errata. The official home of the Python Programming Language. While Javascript is not essential for this website, your interaction with the content will be limited.
Home > Store
Register your product to gain access to bonus material or receive a coupon.
- By Aaron Hillegass, Adam Preble
- Published Nov 9, 2011 by Addison-Wesley Professional.
Book
- Sorry, this book is no longer in print.
eBook (Watermarked)
- Your Price: $31.99
- List Price: $39.99
- Includes EPUB, MOBI, and PDF
This eBook includes the following formats, accessible from your Account page after purchase:
EPUBThe open industry format known for its reflowable content and usability on supported mobile devices.
MOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDFThe popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Description
- Copyright 2012
- Edition: 4th
- Book
- ISBN-10: 0-321-77408-6
- ISBN-13: 978-0-321-77408-8
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® Programming for Mac® 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® Programming for Mac® 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.
Sample Content
Online Sample Chapter
Sample Pages
Download the sample pages (includes Chapter 3 and Index)
Table of Contents
Preface xix
Acknowledgments xxi
Chapter 1: Cocoa: What Is It? 1
A Little History 1
Tools 3
Language 4
Objects, Classes, Methods, and Messages 5
Frameworks 6
How to Read This Book 7
Typographical Conventions 7
Common Mistakes 8
How to Learn 8
Chapter 2: Let’s Get Started 11
In Xcode 11
In Interface Builder 15
A Look at Objective-C 25
Documentation 31
What Have You Done? 31
Chronology of an Application 32
Chapter 3: Objective-C 35
Creating and Using Instances 35
Using Existing Classes 37
Creating Your Own Classes 48
The Debugger 58
What Have You Done? 63
Meet the Static Analyzer 63
For the More Curious: How Does Messaging Work? 65
Challenge 66
Chapter 4: Memory Management 67
Living with Manual Reference Counting 69
Accessor Methods 77
Living with ARC 80
Chapter 5: Target/Action 83
Some Commonly Used Subclasses of NSControl 85
Start the SpeakLine Example 89
Lay Out the XIB File 90
Implementing the SpeakLineAppDelegate Class 94
For the More Curious: Setting the Target Programmatically 96
Challenge 96
Debugging Hints 98
Chapter 6: Helper Objects 99
Delegates 100
The NSTableView and Its dataSource 104
Lay Out the User Interface 107
Make Connections 109
Edit SpeakLineAppDelegate.m 110
For the More Curious: How Delegates Work 113
Challenge: Make a Delegate 114
Challenge: Make a Data Source 114
Chapter 7: Key-Value Coding and Key-Value Observing 117
Key-Value Coding 117
Bindings 119
Key-Value Observing 120
Making Keys Observable 121
Properties 124
For the More Curious: Key Paths 126
For the More Curious: Key-Value Observing 127
Chapter 8: NSArrayController 129
Starting the RaiseMan Application 130
Key-Value Coding and nil 139
Add Sorting 140
For the More Curious: Sorting without NSArrayController 141
Challenge 1 142
Challenge 2 142
Chapter 9: NSUndoManager 145
NSInvocation 145
How the NSUndoManager Works 146
Adding Undo to RaiseMan 148
Key-Value Observing 152
Undo for Edits 153
Begin Editing on Insert 156
For the More Curious: Windows and the Undo Manager 158
Chapter 10: Archiving 159
NSCoder and NSCoding 160
The Document Architecture 163
Saving and NSKeyedArchiver 167
Loading and NSKeyedUnarchiver 168
Setting the Extension and Icon for the File Type 170
For the More Curious: Preventing Infinite Loops 172
For the More Curious: Creating a Protocol 173
For the More Curious: Automatic Document Saving 174
For the More Curious: Document-Based Applications without Undo 175
Universal Type Identifiers 175
Chapter 11: Basic Core Data 177
NSManagedObjectModel 177
Interface 179
For the More Curious: View-Based versus Cell-Based Table Views 191
Challenge 191
Chapter 12: NIB Files and NSWindowController 193
NSPanel 193
Adding a Panel to the Application 194
For the More Curious: NSBundle 204
Challenge 206
Chapter 13: User Defaults 207
NSDictionary and NSMutableDictionary 208
NSUserDefaults 210
Setting Defaults 212
Letting the User Edit the Defaults 213
Using the Defaults 215
For the More Curious: NSUserDefaultsController 217
For the More Curious: Reading and Writing Defaults from the Command Line 217
Challenge 219
Chapter 14: Using Notifications 221
What Notifications Are and Are Not 221
What Notifications Are Not 222
NSNotification 222
NSNotificationCenter 222
Posting a Notification 224
Registering as an Observer 225
Handling the Notification When It Arrives 226
The userInfo Dictionary 226
For the More Curious: Delegates and Notifications 227
Challenge 228
Chapter 15: Using Alert Panels 229
Make the User Confirm the Deletion 230
Challenge 232
Chapter 16: Localization 233
Localizing a NIB File 234
String Tables 236
For the More Curious: ibtool 239
For the More Curious: Explicit Ordering of Tokens in Format Strings 240
Chapter 17: Custom Views 241
The View Hierarchy 241
Get a View to Draw Itself 243
Drawing with NSBezierPath 248
NSScrollView 250
Creating Views Programmatically 252
For the More Curious: Cells 253
For the More Curious: isFlipped 255
Challenge 255
Chapter 18: Images and Mouse Events 257
NSResponder 257
NSEvent 257
Getting Mouse Events 259
Using NSOpenPanel 259
Composite an Image onto Your View 264
The View’s Coordinate System 266
Autoscrolling 268
For the More Curious: NSImage 269
Challenge 270
Chapter 19: Keyboard Events 271
NSResponder 273
NSEvent 273
Create a New Project with a Custom View 274
For the More Curious: Rollovers 282
The Fuzzy Blue Box 284
Chapter 20: Drawing Text with Attributes 285
NSFont 285
NSAttributedString 286
Drawing Strings and Attributed Strings 289
Making Letters Appear 289
Getting Your View to Generate PDF Data 291
For the More Curious: NSFontManager 293
Challenge 1 293
Challenge 2 294
Chapter 21: Pasteboards and Nil-Targeted Actions 295
NSPasteboard 296
Add Cut, Copy, and Paste to BigLetterView 298
Nil-Targeted Actions 300
For the More Curious: Which Object Sends the Action Message? 303
For the More Curious: UTIs and the Pasteboard 303
For the More Curious: Lazy Copying 304
Challenge 1 305
Challenge 2 305
Chapter 22: Categories 307
Add a Method to NSString 307
For the More Curious: Declaring Private Methods 309
Chapter 23: Drag-and-Drop 311
Make BigLetterView a Drag Source 312
Make BigLetterView a Drag Destination 315
For the More Curious: Operation Mask 319
Chapter 24: NSTimer 321
Lay Out the Interface 323
Make Connections 325
Add Code to TutorController 326
For the More Curious: NSRunLoop 328
Challenge 328
Chapter 25: Sheets 329
Adding a Sheet 330
For the More Curious: contextInfo 335
For the More Curious: Modal Windows 336
Chapter 26: Creating NSFormatters 339
A Basic Formatter 341
The Delegate of the NSControl Class 347
Checking Partial Strings 348
Formatters That Return Attributed Strings 350
For the More Curious: NSValueTransformer 351
Chapter 27: Printing 353
Dealing with Pagination 353
For the More Curious: Are You Drawing to the Screen? 358
Challenge 358
Chapter 28: Web Services 359
RanchForecast Project 360
Opening URLs 368
Challenge: Add a WebView 369
Chapter 29: Blocks 371
Block Syntax 373
Challenge: Design a Delegate 381
Chapter 30: Developing for iOS 383
Porting RanchForecast to iOS 383
RootViewController 386
Add a Navigation Controller 388
ScheduleViewController 391
UITableViewController 392
Pushing View Controllers 393
Challenge 395
Chapter 31: View Swapping 397
Get Started 398
Add View Swapping to MyDocument 401
Resizing the Window 403
Chapter 32: Core Data Relationships 407
Edit the Model 407
Create Custom NSManagedObject Classes 409
Lay Out the Interface 411
EmployeeView.xib 413
Events and nextResponder 414
Chapter 33: Core Animation 417
Scattered 417
Civ 6 mac requirements. Implicit Animation and Actions 423
Challenge 1 425
Challenge 2 425
Chapter 34: Concurrency 427
Multithreading 427
Improving Scattered: Time Profiling in Instruments 431
NSOperationQueue 435
For the More Curious: Faster Scattered 438
Challenge 439
Chapter 35: Cocoa and OpenGL 441
A Simple Cocoa/OpenGL Application 442
Chapter 36: NSTask 451
ZIPspector 451
Challenge: .tar and .tgz files 460
Chapter 37: Distributing Your App 461
Build Configurations 461
Creating a Release Build 464
Application Sandboxing 466
The Mac App Store 468
Chapter 38: The End 471
Index 473
More Information
Other Things You Might Like
- Book $35.99
- Book $39.99
- eBook (Watermarked) $31.99
This directory contains binaries for a base distribution and packages to run on Mac OS X (release 10.6 and above). Mac OS 8.6 to 9.2 (and Mac OS X 10.1) are no longer supported but you can find the last supported release of R for these systems (which is R 1.7.1) here. Releases for old Mac OS X systems (through Mac OS X 10.5) and PowerPC Macs can be found in the old directory.
Note: CRAN does not have Mac OS X systems and cannot check these binaries for viruses.Although we take precautions when assembling binaries, please use the normal precautions with downloaded executables.
Package binaries for R versions older than 3.2.0 are only available from the CRAN archive so users of such versions should adjust the CRAN mirror setting (https://cran-archive.r-project.org) accordingly.
R 3.6.3 'Holding the Windsock' released on 2020/02/29
Important: since R 3.4.0 release we are now providing binaries for OS X 10.11 (El Capitan) and higher using non-Apple toolkit to provide support for OpenMP and C++17 standard features. To compile packages you may have to download tools from the tools directory and read the corresponding note below.
Please check the MD5 checksum of the downloaded image to ensure that it has not been tampered with or corrupted during the mirroring process. For example type
md5 R-3.6.3.pkg
in the Terminal application to print the MD5 checksum for the R-3.6.3.pkg image. On Mac OS X 10.7 and later you can also validate the signature using
pkgutil --check-signature R-3.6.3.pkg
Latest release:
R-3.6.3.pkg (notarized, for Catalina) SHA1-hash: 2677aaf9da03e101f9e651c80dbec25461479f56 (ca. 77MB) R-3.6.3.nn.pkg (regular) | R 3.6.3 binary for OS X 10.11 (El Capitan) and higher, signed package. Contains R 3.6.3 framework, R.app GUI 1.70 in 64-bit for Intel Macs, Tcl/Tk 8.6.6 X11 libraries and Texinfo 5.2. The latter two components are optional and can be ommitted when choosing 'custom install', they are only needed if you want to use the tcltk R package or build package documentation from sources. macOS Catalina users must use notarized version which enforces hardened run-time. All others can use regular version which uses the same runtime as previous R releases. R 3.6.2 was the last version that can be run on Catalina with regular runtime. Note: the use of X11 (including tcltk) requires XQuartz to be installed since it is no longer part of OS X. Always re-install XQuartz when upgrading your macOS to a new major version. Important: this release uses Clang 7.0.0 and GNU Fortran 6.1, neither of which is supplied by Apple. If you wish to compile R packages from sources, you will need to download and install those tools - see the tools directory. |
NEWS (for Mac GUI) | News features and changes in the R.app Mac GUI |
Mac-GUI-1.70.tar.gz MD5-hash: b1ef5f285524640680a22965bb8800f8 | Sources for the R.app GUI 1.70 for Mac OS X. This file is only needed if you want to join the development of the GUI, it is not intended for regular users. Read the INSTALL file for further instructions. |
Note: Previous R versions for El Capitan can be found in the el-capitan/base directory.Binaries for legacy OS X systems: | |
R-3.3.3.pkg MD5-hash: 893ba010f303e666e19f86e4800f1fbf SHA1-hash: 5ae71b000b15805f95f38c08c45972d51ce3d027 (ca. 71MB) | R 3.3.3 binary for Mac OS X 10.9 (Mavericks) and higher, signed package. Contains R 3.3.3 framework, R.app GUI 1.69 in 64-bit for Intel Macs, Tcl/Tk 8.6.0 X11 libraries and Texinfo 5.2. The latter two components are optional and can be ommitted when choosing 'custom install', it is only needed if you want to use the tcltk R package or build package documentation from sources. Note: the use of X11 (including tcltk) requires XQuartz to be installed since it is no longer part of OS X. Always re-install XQuartz when upgrading your OS X to a new major version. |
R-3.2.1-snowleopard.pkg MD5-hash: 58fe9d01314d9cb75ff80ccfb914fd65 SHA1-hash: be6e91db12bac22a324f0cb51c7efa9063ece0d0 (ca. 68MB) | R 3.2.1 legacy binary for Mac OS X 10.6 (Snow Leopard) - 10.8 (Mountain Lion), signed package. Contains R 3.2.1 framework, R.app GUI 1.66 in 64-bit for Intel Macs. This package contains the R framework, 64-bit GUI (R.app), Tcl/Tk 8.6.0 X11 libraries and Texinfop 5.2. GNU Fortran is NOT included (needed if you want to compile packages from sources that contain FORTRAN code) please see the tools directory. NOTE: the binary support for OS X before Mavericks is being phased out, we do not expect further releases! |
Subdirectories:
tools | Additional tools necessary for building R for Mac OS X: Universal GNU Fortran compiler for Mac OS X (see R for Mac tools page for details). |
el-capitan | Binaries of package builds for OS X 10.11 or higher (El Capitan build) |
mavericks | Binaries of package builds for Mac OS X 10.9 or higher (Mavericks build) |
old | Previously released R versions for Mac OS X |
You may also want to read the R FAQ and R for Mac OS X FAQ. For discussion of Mac-related topics and reporting Mac-specific bugs, please use the R-SIG-Mac mailing list.
Information, tools and most recent daily builds of the R GUI, R-patched and R-devel can be found at http://mac.R-project.org/. Please visit that page especially during beta stages to help us test the Mac OS X binaries before final release!
Package maintainers should visit CRAN check summary page to see whether their package is compatible with the current build of R for Mac OS X.
Binary libraries for dependencies not present here are available from http://mac.R-project.org/libs and corresponding sources at http://mac.R-project.org/src.
Last modified: 2020/03/07, by Simon Urbanek