Cocoa Tutorial for Java Programmers

Total Page:16

File Type:pdf, Size:1020Kb

Cocoa Tutorial for Java Programmers Cocoa Tutorial for Java Programmers 2006-10-03 Java and all Java-based trademarks are Apple Computer, Inc. trademarks or registered trademarks of Sun © 2002, 2006 Apple Computer, Inc. Microsystems, Inc. in the U.S. and other All rights reserved. countries. Simultaneously published in the United No part of this publication may be States and Canada. reproduced, stored in a retrieval system, or Even though Apple has reviewed this document, transmitted, in any form or by any means, APPLE MAKES NO WARRANTY OR mechanical, electronic, photocopying, REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS recording, or otherwise, without prior DOCUMENT, ITS QUALITY, ACCURACY, written permission of Apple Computer, Inc., MERCHANTABILITY, OR FITNESS FOR A with the following exceptions: Any person PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND is hereby authorized to store documentation YOU, THE READER, ARE ASSUMING THE on a single computer for personal use only ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. and to print copies of documentation for IN NO EVENT WILL APPLE BE LIABLE FOR personal use provided that the DIRECT, INDIRECT, SPECIAL, INCIDENTAL, documentation contains Apple’s copyright OR CONSEQUENTIAL DAMAGES notice. RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if The Apple logo is a trademark of Apple advised of the possibility of such damages. Computer, Inc. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN Use of the “keyboard” Apple logo LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, (Option-Shift-K) for commercial purposes or employee is authorized to make any without the prior written consent of Apple modification, extension, or addition to this may constitute trademark infringement and warranty. unfair competition in violation of federal Some states do not allow the exclusion or limitation of implied warranties or liability for and state laws. incidental or consequential damages, so the above limitation or exclusion may not apply to No licenses, express or implied, are granted you. This warranty gives you specific legal with respect to any of the technology rights, and you may also have other rights which vary from state to state. described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled or Apple-licensed computers. Every effort has been made to ensure that the information in this document is accurate. Apple is not responsible for typographical errors. Apple Computer, Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Aqua, Carbon, Cocoa, iTunes, Mac, Mac OS, Quartz, and Xcode are trademarks of Apple Computer, Inc., registered in the United States and other countries. Finder is a trademark of Apple Computer, Inc. Objective-C is a registered trademark of NeXT Software, Inc. Contents Introduction Introduction to Cocoa Tutorial for Java Programmers 7 Organization of This Document 8 See Also 9 Chapter 1 Creating the Currency Converter Project and User Interface 11 Creating the Currency Converter Project 11 Open Xcode 11 Choose the New Project Command 12 Choose a Project Type 12 Creating the Currency Converter User Interface 15 What Is a Nib File? 15 Open the Main Nib File 16 Windows in Cocoa 16 Resize the Window 17 Set the Window’s Title and Other Attributes 19 Set the Application Name in the Menu 19 Configure a Text Field 19 Duplicate an Object 21 Change the Attributes of a Text Field 21 Assign Labels to the Fields 21 Configure a Button 23 Add a Horizontal Decorative Line 24 Interface Layout and Object Alignment 25 Finalize the Window Layout 25 Enable Tabbing Between Text Fields 26 Set the First Responder for the Currency Converter Window 27 Test the Interface 28 Defining the ConverterController Class 29 Classes and Objects 29 Specify the ConverterController Class 29 Paths for Object Communication: Outlets, Targets, and Actions 30 Define the User Interface and Model Outlets of the ConverterController Class 33 Define the Actions of the ConverterController Class 34 Interconnecting the ConverterController Class and the User Interface 35 Create an Instance of the ConverterController Class 35 Connect the ConverterController Class to the Text Fields 35 3 2006-10-03 | © 2002, 2006 Apple Computer, Inc. All Rights Reserved. CONTENTS Connect the Convert Button to the ConverterController convert Action Method 36 Defining the Converter Class 37 Chapter 2 Implementing Currency Converter 39 Generate the Source Files 39 Place the Implementation Files in the Appropriate Group 40 Implement the Currency Converter Classes 41 Chapter 3 Building Currency Converter 43 Overview of the Build Process 43 Build the Currency Converter Application 43 Look Up Documentation 44 Run Currency Converter 44 Correct Build Errors 44 Great Job! 45 Chapter 4 Expanding on the Basics 47 Application and Window Behavior 47 Controls and Text 47 Menu Commands 48 Document Management 48 File Management 48 Communicating With Other Applications 49 Custom Drawing and Animation 49 Internationalization 49 Editing Support 49 Printing 49 Help 50 Plug-in Architecture 50 Chapter 5 Adopting Objective-C 51 Learn the Objective-C Language 51 Learn the Cocoa Class Hierarchy 52 Learn Memory Management in Cocoa 52 Document Revision History 55 4 2006-10-03 | © 2002, 2006 Apple Computer, Inc. All Rights Reserved. Figures and Listings Introduction Introduction to Cocoa Tutorial for Java Programmers 7 Figure I-1 The Currency Converter main window 7 Chapter 1 Creating the Currency Converter Project and User Interface 11 Figure 1-1 The Xcode application icon 11 Figure 1-2 Xcode New Project Assistant 12 Figure 1-3 Entering a project’s name and choosing its location in Xcode New Project Assistant 13 Figure 1-4 The new Currency Converter project in Xcode 14 Figure 1-5 Resizing a window manually 18 Figure 1-6 Resizing a window with the NSWindow inspector 18 Figure 1-7 Cocoa text controls in the Interface Builder palette window 20 Figure 1-8 Resizing a text field 20 Figure 1-9 Right-aligning a text label in Interface Builder 22 Figure 1-10 Aligned text fields and labels in Interface Builder 23 Figure 1-11 Measuring distances in Interface Builder 24 Figure 1-12 Adding a horizontal line to the Currency Converter window 24 Figure 1-13 Currency Converter’s final user interface in Interface Builder 26 Figure 1-14 Connecting nextKeyView outlets in Interface Builder 27 Figure 1-15 Setting the initialFirstResponder outlet in Interface Builder 28 Figure 1-16 Subclassing java.lang.Object 30 Figure 1-17 An outlet pointing from one object to another 30 Figure 1-18 Relationships in the target-action paradigm 32 Figure 1-19 Outlets and actions in the ConverterController inspector 34 Figure 1-20 A newly instantiated ConverterController instance 35 Figure 1-21 Connecting ConverterController to the rateField outlet 36 Figure 1-22 Connecting ConverterController.converter to the Converter instance 38 Chapter 2 Implementing Currency Converter 39 Listing 2-1 Implementation of the Converter class 41 Listing 2-2 Implementation of the ConverterController class 42 Chapter 3 Building Currency Converter 43 Figure 3-1 Identifying build errors 45 5 2006-10-03 | © 2002, 2006 Apple Computer, Inc. All Rights Reserved. FIGURES AND LISTINGS 6 2006-10-03 | © 2002, 2006 Apple Computer, Inc. All Rights Reserved. INTRODUCTION Introduction to Cocoa Tutorial for Java Programmers Important: The Java API for Cocoa is deprecated in Mac OS X version 10.4 and later. You should use the Objective-C API instead. For a tutorial on using Cocoa with Objective-C, see Cocoa Application Tutorial Using Objective-C. This document introduces the Cocoa application environment using the Java language and teaches you how to leverage Apple’s development tools to build robust, object-oriented applications. Cocoa provides the best way to build modern, multimedia-rich, object-oriented applications for consumers and enterprise customers alike. This document assumes you are familiar with Java programming but does not assume you have previous experience with Cocoa or Xcode Tools. This document is intended for Java programmers interested in developing Cocoa applications. Keep in mind, however, that Java is not Cocoa’s native language. To develop Cocoa applications that you intend to release to end users, you must use Objective-C. No Java interfaces for new Cocoa features will be added to Mac OS X versions after 10.4. Therefore, features added to Cocoa in subsequent versions Mac OS X will not be available to Cocoa applications developed using Java. This document shows how to build Currency Converter, an application that converts a dollar amount to an amount in another currency, given the rate of that currency relative to the dollar. The main window of the finished application is shown in Figure I-1. Figure I-1 The Currency Converter main window 7 2006-10-03 | © 2002, 2006 Apple Computer, Inc. All Rights Reserved. INTRODUCTION Introduction to Cocoa Tutorial for Java Programmers Currency Converter is a simple application, yet it exemplifies much of what software development with Cocoa is all about. As you’ll discover, Currency Converter is amazingly easy to create, and it’s equally amazing how many features you get “for free”—as with all Cocoa applications. This document leads you through the basic steps for creating a Cocoa application. It shows how to: ■ Create an Xcode project ■ Create a graphical user interface using Interface Builder ■ Create a custom subclass of a Cocoa framework class ■ Connect an instance of your custom subclass to the user interface ■ Build an application and correct problems By following the instructions provided in this document, you familiarize yourself with the two most important applications used for developing Mac OS X applications: Interface Builder and Xcode.
Recommended publications
  • Cocoa Touch & Iphone
    Music Appreciation 243: Introduction to Rick Astley Evan Doll [email protected] Alan Cannistraro [email protected] Thursday, April 2, 2009 Thursday, April 2, 2009 Welcome to CS193P: iPhone Application Development Evan Doll [email protected] Alan Cannistraro [email protected] Thursday, April 2, 2009 Staff • Lecturers ■ Evan Doll [email protected] ■ Alan Cannistraro [email protected] • Student TAs ■ Troy Brant [email protected] ■ Paul Salzman [email protected] • “Professor Emeritus” ■ Paul Marcos [email protected] Thursday, April 2, 2009 How many of you... • Are familiar with object-oriented programming? • Have developed software with Mac OS X? • Have developed apps for the iPhone? Thursday, April 2, 2009 Lectures, Sections, Office Hours • Lectures ■ 320-105, Monday & Wednesday 3:15 – 4:30 PM • Optional Section ■ 200-205, Friday 3:15 – 4:05 PM as announced ■ Guest speakers, additional topics ■ First one will be next Friday 4/10 • Office Hours ■ Troy and Paul will be holding office hours ■ Time & location TBD, check website for details Thursday, April 2, 2009 Requirements • Prerequisite: CS 106B/X • Recommended Book: None, we’ll use Apple documentation • You must have access to an Intel-based Macintosh ■ Running Mac OS X 10.5 Leopard ■ iPhone SDK (Not available on cluster computers!) • Owning an iPhone or iPod Touch is not required ■ Assignments may be done with the iPhone Simulator ■ Loaner iPod Touches should be available, more details to come Thursday, April 2, 2009 Enrollment • Response has been phenomenal again
    [Show full text]
  • Programming Java for OS X
    Programming Java for OS X hat’s so different about Java on a Mac? Pure Java applica- tions run on any operating system that supports Java. W Popular Java tools run on OS X. From the developer’s point of view, Java is Java, no matter where it runs. Users do not agree. To an OS X user, pure Java applications that ignore the feel and features of OS X are less desirable, meaning the customers will take their money elsewhere. Fewer sales translates into unhappy managers and all the awkwardness that follows. In this book, I show how to build GUIs that feel and behave like OS X users expect them to behave. I explain development tools and libraries found on the Mac. I explore bundling of Java applications for deployment on OS X. I also discuss interfacing Java with other languages commonly used on the Mac. This chapter is about the background and basics of Java develop- ment on OS X. I explain the history of Java development. I show you around Apple’s developer Web site. Finally, I go over the IDEs commonly used for Java development on the Mac. In This Chapter Reviewing Apple Java History Exploring the history of Apple embraced Java technologies long before the first version of Java on Apple computers OS X graced a blue and white Mac tower. Refugees from the old Installing developer tan Macs of the 1990s may vaguely remember using what was tools on OS X called the MRJ when their PC counterparts were busy using JVMs. Looking at the MRJ stands for Mac OS Runtime for Java.
    [Show full text]
  • Using the Java Bridge
    Using the Java Bridge In the worlds of Mac OS X, Yellow Box for Windows, and WebObjects programming, there are two languages in common use: Java and Objective-C. This document describes the Java bridge, a technology from Apple that makes communication between these two languages possible. The first section, ÒIntroduction,Ó gives a brief overview of the bridgeÕs capabilities. For a technical overview of the bridge, see ÒHow the Bridge WorksÓ (page 2). To learn how to expose your Objective-C code to Java, see ÒWrapping Objective-C FrameworksÓ (page 9). If you want to write Java code that references Objective-C classes, see ÒUsing Java-Wrapped Objective-C ClassesÓ (page 6). If you are writing Objective-C code that references Java classes, read ÒUsing Java from Objective-CÓ (page 5). Introduction The original OpenStep system developed by NeXT Software contained a number of object-oriented frameworks written in the Objective-C language. Most developers who used these frameworks wrote their code in Objective-C. In recent years, the number of developers writing Java code has increased dramatically. For the benefit of these programmers, Apple Computer has provided Java APIs for these frameworks: Foundation Kit, AppKit, WebObjects, and Enterprise Objects. They were made possible by using techniques described later in Introduction 1 Using the Java Bridge this document. You can use these same techniques to expose your own Objective-C frameworks to Java code. Java and Objective-C are both object-oriented languages, and they have enough similarities that communication between the two is possible. However, there are some differences between the two languages that you need to be aware of in order to use the bridge effectively.
    [Show full text]
  • Darwin: Mac OS X's Core OS
    ADC April 2001 3/8/01 1:57 PM Page 1 Apple Developer Connection Direct Darwin: Mac OS X’s Core OS eneath Mac OS X’s user-friendly and attractive user interface, Most of the reference documents can be Aqua, and the application frameworks (Classic, Carbon and found in the /Developer/Documentation/ BCocoa) is Darwin: Mac OS X’s core OS. Unseen by users, Kernel directory on any Mac OS X system Darwin provides a strong yet flexible foundation with features like with the Mac OS X Developer Tools package preemptive multitasking, protected memory and real-time support installed. that make Mac OS X a truly modern operating system. The focus of this article is to provide a brief overview of Components of Darwin Darwin and its components as well as give an introduction to Just like in the old Reese’s Peanut Butter developing kernel extensions—modules that extend Darwin’s Cups commercials (“You’ve got chocolate in functionality. For more in-depth information, you should read my peanut butter… No, you’ve got peanut butter on my choco- Inside Mac OS X: Kernel Environment which is available, along late!”), Darwin blends a mixture of mature industry standard com- with other documents referred to in this article, on the Apple ponents such as Mach and BSD with Apple-engineered components Developer Connection (ADC) web site in the Mac OS X to provide Mac OS X with a stable, reliable and extensible founda- Documentation section: tion. Darwin consists of five main components: Mach, I/O Kit, File http://developer.apple.com/techpubs/macosx/macosx.html System, Networking and BSD.
    [Show full text]
  • Webkit DOM Programming Topics
    WebKit DOM Programming Topics Apple Applications > Safari 2008-10-15 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS Apple Inc. PROVIDED “AS IS,” AND YOU, THE READER, ARE © 2004, 2008 Apple Inc. ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. All rights reserved. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR No part of this publication may be reproduced, CONSEQUENTIAL DAMAGES RESULTING FROM ANY stored in a retrieval system, or transmitted, in DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. any form or by any means, mechanical, THE WARRANTY AND REMEDIES SET FORTH ABOVE electronic, photocopying, recording, or ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL otherwise, without prior written permission of OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make Apple Inc., with the following exceptions: Any any modification, extension, or addition to this person is hereby authorized to store warranty. documentation on a single computer for Some states do not allow the exclusion or limitation personal use only and to print copies of of implied warranties or liability for incidental or consequential damages, so the above limitation or documentation for personal use provided that exclusion may not apply to you. This warranty gives the documentation contains Apple’s copyright you specific legal rights, and you may also have notice. other rights which vary from state to state. The Apple logo is a trademark of Apple Inc. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws.
    [Show full text]
  • Mac Os Versions in Order
    Mac Os Versions In Order Is Kirby separable or unconscious when unpins some kans sectionalise rightwards? Galeate and represented Meyer videotapes her altissimo booby-trapped or hunts electrometrically. Sander remains single-tax: she miscalculated her throe window-shopped too epexegetically? Fixed with security update it from the update the meeting with an infected with machine, keep your mac close pages with? Checking in macs being selected text messages, version of all sizes trust us, now became an easy unsubscribe links. Super user in os version number, smartphones that it is there were locked. Safe Recover-only Functionality for Lost Deleted Inaccessible Mac Files Download Now Lost grate on Mac Don't Panic Recover Your Mac FilesPhotosVideoMusic in 3 Steps. Flex your mac versions; it will factory reset will now allow users and usb drive not lower the macs. Why we continue work in mac version of the factory. More secure your mac os are subject is in os x does not apply video off by providing much more transparent and the fields below. Receive a deep dive into the plain screen with the technology tally your search. MacOS Big Sur A nutrition sheet TechRepublic. Safari was in order to. Where can be quit it straight from the order to everyone, which can we recommend it so we come with? MacOS Release Dates Features Updates AppleInsider. It in order of a version of what to safari when using an ssd and cookies to alter the mac versions. List of macOS version names OS X 10 beta Kodiak 13 September 2000 OS X 100 Cheetah 24 March 2001 OS X 101 Puma 25.
    [Show full text]
  • Toga Documentation Release 0.2.0
    Toga Documentation Release 0.2.0 Russell Keith-Magee September 05, 2016 Contents 1 Quickstart 3 1.1 Prerequisites...............................................3 1.2 Problems with source installs......................................3 1.3 Problems using virtualenv under Linux.................................3 2 Community 5 3 Contents 7 3.1 Why Toga?................................................7 3.2 Tutorial..................................................9 3.3 Reference................................................. 19 3.4 Toga internals.............................................. 20 i ii Toga Documentation, Release 0.2.0 Toga is a Python native, OS native, cross platform GUI toolkit. Contents 1 Toga Documentation, Release 0.2.0 2 Contents CHAPTER 1 Quickstart In your virtualenv, install Toga, and then run it: $ pip install toga-demo $ toga-demo This will pop up a GUI window showing the full range of widgets available to an application using Toga. 1.1 Prerequisites Toga has some minimum requirements: • If you’re on OS X, you need to be on 10.7 (Lion) or newer. • If you’re on Linux, you need to have GTK+ 3.4 or later. This is the version that ships with Ubuntu 12.04; you’ll need to have the python-gi (or python3-gi if you’re using Python 3) package installed. If you want to use the WebView widget, you’ll also need to have WebKit, plus the GI bindings to WebKit (gir1.2-webkit-3.0) installed. If these requirements aren’t met, Toga either won’t work at all, or won’t have full functionality. 1.2 Problems with source installs Internally, Toga is comprised of a number of subpackages - one for each platform it supports. If you install using wheels, the install process will correctly identify the required packages and install them.
    [Show full text]
  • Auditing and Exploiting Apple IPC Ianbeer
    Auditing and Exploiting Apple IPC ianbeer Jailbreak Security Summit May 2015 About me: ● Security Researcher with Project Zero ● Won pwn4fun last year with a JavaScriptCore bug and some kernel bugs ● That macbook air now runs ubuntu :) ● Over the last year reported ~60 OS X sandbox escapes/priv-escs (10 still unpatched) ● Some accidentally also present on iOS This talk: ● Overview of (almost) all IPC mechanisms on iOS/OS X ● Quick look at Mach Message fundamentals ● Deep-dive into XPC services ● Exploiting XPC bugs ● fontd IPC and exploiting fontd bugs ● Mitigations and the future socketpair semaphores AppleEvents IPC Zoo signals domain sockets fifo shmem Pasteboard CFMessage Distributed NSXPC A B Port Notifications D CFPort MIG XPC O Mach Messages XNU Why care about IPC? Sandboxing You probably get initial code execution in some kind of sandbox in userspace… ● renderer/plugin process ● quicklook-satellite ● ntpd Plenty of stuff is still unsandboxed on OS X ● appstore app though (...Adobe Reader...) Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code Untrusted helper Trusted “broker” IPC Sandboxed Unsandboxed Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code Chrome PPAPI Plugin Browser IPC Sandboxed Unsandboxed Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code WebContent WebKit2/Safari IPC Sandboxed Unsandboxed Sandbox escape models Privilege
    [Show full text]
  • Javascript Scripting Guide for Quicktime
    JavaScript Scripting Guide for QuickTime 2005-10-04 Java and all Java-based trademarks are Apple Computer, Inc. trademarks or registered trademarks of Sun © 2004, 2005 Apple Computer, Inc. Microsystems, Inc. in the U.S. and other All rights reserved. countries. Simultaneously published in the United No part of this publication may be States and Canada. reproduced, stored in a retrieval system, or Even though Apple has reviewed this document, transmitted, in any form or by any means, APPLE MAKES NO WARRANTY OR mechanical, electronic, photocopying, REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS recording, or otherwise, without prior DOCUMENT, ITS QUALITY, ACCURACY, written permission of Apple Computer, Inc., MERCHANTABILITY, OR FITNESS FOR A with the following exceptions: Any person PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND is hereby authorized to store documentation YOU, THE READER, ARE ASSUMING THE on a single computer for personal use only ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. and to print copies of documentation for IN NO EVENT WILL APPLE BE LIABLE FOR personal use provided that the DIRECT, INDIRECT, SPECIAL, INCIDENTAL, documentation contains Apple’s copyright OR CONSEQUENTIAL DAMAGES notice. RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if The Apple logo is a trademark of Apple advised of the possibility of such damages. Computer, Inc. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN Use of the “keyboard” Apple logo LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, (Option-Shift-K) for commercial purposes or employee is authorized to make any without the prior written consent of Apple modification, extension, or addition to this may constitute trademark infringement and warranty.
    [Show full text]
  • Cocoa® Programming for Mac® Os X
    COCOA® PROGRAMMING FOR MAC® OS X FOURTH EDITION This page intentionally left blank COCOA® PROGRAMMING FOR MAC® OS X FOURTH EDITION Aaron Hillegass Adam Preble Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States, please contact: International Sales [email protected] Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Hillegass, Aaron. Cocoa programming for Mac OS X / Aaron Hillegass, Adam Preble.—4th ed. p. cm. Includes index. ISBN 978-0-321-77408-8 (pbk. : alk.
    [Show full text]
  • Cocoa® Programming Developer's Handbook
    Cocoa® Programming Developer’s Handbook This page intentionally left blank Cocoa® Programming Developer’s Handbook David Chisnall Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Cocoa® Programming Developer’s Handbook Editor-in-Chief Copyright © 2010 Pearson Education, Inc. Mark L. Taub All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, Managing Editor or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, John Fuller without written permission from the publisher. No patent liability is assumed with respect to Full-Service the use of the information contained herein. Although every precaution has been taken in Production the preparation of this book, the publisher and author assume no responsibility for errors Manager or omissions. Nor is any liability assumed for damages resulting from the use of the Julie B. Nahil information contained herein. Technical Reviewer ISBN-13: 978-0-321-63963-9 Gregory ISBN-10: 0-321-63963-4 Casamento Book Designer Library of Congress Cataloging-in-Publication Data Gary Adair Chisnall, David. Composition Cocoa programming developer’s handbook / David Chisnall. David Chisnall p. cm. Includes index. ISBN 978-0-321-63963-9 (pbk. : alk. paper) 1. Cocoa (Application development environment) 2. Object-oriented programming (Computer science) 3. Application program interfaces (Computer software) 4. Mac OS. I. Title. QA76.64.C485 2010 005.26’8—dc22 2009042661 Printed in the United States on recycled paper at Edwards Brothers in Ann Arbor, Michigan. First Printing December 2009 Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized.
    [Show full text]
  • Cocoa and Objective-C: up and Running
    Cocoa and Objective-C: Up and Running Cocoa and Objective-C: Up and Running Scott Stevenson Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo Cocoa and Objective-C: Up and Running by Scott Stevenson Copyright © 2010 Scott Stevenson. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Brian Jepson Indexer: Ellen Troutman Zaig Production Editor: Adam Zaremba Cover Designer: Karen Montgomery Copyeditor: Nancy Kotary Interior Designer: David Futato Proofreader: Sada Preisch Illustrator: Robert Romano Printing History: April 2010: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Cocoa and Objective-C: Up and Running, the image of a Pampas cat, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. TM This book uses RepKover™, a durable and flexible lay-flat binding.
    [Show full text]