Online Book Reader

Home Category

Cocoa Programming for Mac OS X - Aaron Hillegass [3]

By Root 915 0

Challenge 1

Challenge 2

Chapter 34 Concurrency

Multithreading

A Deep Chasm Opens Before You

Simple Cocoa Background Threads

Improving Scattered: Time Profiling in Instruments

Introducing Instruments

NSOperationQueue

Multithreaded Scattered

Thread Synchronization

For the More Curious: Faster Scattered

Challenge

Chapter 35 Cocoa and OpenGL

A Simple Cocoa/OpenGL Application

Lay Out the Interface

Write Code

Chapter 36 NSTask

ZIPspector

Asynchronous Reads

iPing

Challenge: .tar and .tgz files

Chapter 37 Distributing Your App

Build Configurations

Preprocessor Macros and Using Build Configurations to Change Behavior

Creating a Release Build

Application Sandboxing

Entitlements

Mediated File Access and Powerbox

The Mac App Store

Chapter 38 The End

Index

Preface


If you are developing applications for the Mac, or are hoping to do so, this book is just the resource you need. Does it cover everything you will ever want to know about programming for the Mac? Of course not. But it does cover probably 80% of what you need to know. You can find the remaining 20%—the 20% that is unique to you—in Apple’s online documentation.

This book, then, acts as a foundation. It covers the Objective-C language and the major design patterns of Cocoa. It will also get you started with the two most commonly used developer tools: Xcode and Instruments. After reading this book, you will be able to understand and utilize Apple’s online documentation.

There is a lot of code in this book. Through that code, we will introduce you to the idioms of the Cocoa community. Our hope is that by presenting exemplary code, we can help you to become more than a Cocoa developer—a stylish Cocoa developer.

This fourth edition includes technologies introduced in Mac OS X 10.6 and 10.7. These include Xcode 4, ARC, blocks, view-based table views, and the Mac App Store. We have also devoted one chapter to the basics of iOS development.

This book is written for programmers who already know some C programming and something about objects. If you don’t know C or objects, you should first read Objective-C Programming: The Big Nerd Ranch Guide. You are not expected to have any experience with Mac programming. This hands-on book assumes that you have access to Mac OS X and the developer tools. Xcode 4.2, Apple’s IDE, is available for free. If you are a member of the paid Mac or iOS Developer Programs, Xcode can also be downloaded from the Apple Developer Connection Web site (http://developer.apple.com/). Enrollment in these programs enables you to submit your applications to the Mac and iOS App Stores, respectively.

We have tried to make this book as useful for you as possible, if not indispensable. That said, we’d love to hear from you at cocoabook@bignerdranch.com if you have any suggestions for improving it.

—Aaron Hillegass and Adam Preble

Acknowledgments


Creating this book required the efforts of many people. We want to thank them for their help. Their contributions have made this a better book than we could have ever written alone.

Thanks to the students who took the Cocoa programming course at the Big Nerd Ranch. They helped us work the kinks out of the exercises and explanations that appear here. Their curiosity inspired us to make the book more comprehensive, and their patience made it possible.

Thank you to all the readers of the first three editions, who made such great suggestions on our forums (http://forums.bignerdranch.com/).

Thank you to all the instructors at the Ranch, who made great additions and caught many of our most egregious errors.

A final shout out to the people at Addison-Wesley, who took our manuscript and made it into a book. They put the book on trucks and convinced bookstores to put it on the shelves. Without their help, it would still be just a stack of paper.

Chapter 1. Cocoa: What Is It?

A Little History


The story of Cocoa starts with a delightful

Return Main Page Previous Page Next Page

®Online Book Reader