Cocoa Tutorial for Java Programmers
(Legacy)
PDF
Introduction
Creating the Currency Converter Project and User Interface
Creating the Currency Converter Project
Open Xcode
Choose the New Project Command
Choose a Project Type
Creating the Currency Converter User Interface
What Is a Nib File?
Open the Main Nib File
Windows in Cocoa
NSWindow and the Window Server
Application, Window, View
Key and Main Windows
Resize the Window
Set the Window’s Title and Other Attributes
Set the Application Name in the Menu
Configure a Text Field
Duplicate an Object
Change the Attributes of a Text Field
Assign Labels to the Fields
Configure a Button
Add a Horizontal Decorative Line
Interface Layout and Object Alignment
Finalize the Window Layout
Enable Tabbing Between Text Fields
Set the First Responder for the Currency Converter Window
Test the Interface
Defining the ConverterController Class
Classes and Objects
Specify the ConverterController Class
Paths for Object Communication: Outlets, Targets, and Actions
Outlets
Target/Action in Interface Builder
Which Direction to Connect?
Define the User Interface and Model Outlets of the ConverterController Class
Define the Actions of the ConverterController Class
Interconnecting the ConverterController Class and the User Interface
Create an Instance of the ConverterController Class
Connect the ConverterController Class to the Text Fields
Connect the Convert Button to the ConverterController convert Action Method
Defining the Converter Class
Implementing Currency Converter
Generate the Source Files
Place the Implementation Files in the Appropriate Group
Implement the Currency Converter Classes
Building Currency Converter
Overview of the Build Process
Build the Currency Converter Application
Look Up Documentation
Run Currency Converter
Correct Build Errors
Great Job!
Expanding on the Basics
Application and Window Behavior
Controls and Text
Menu Commands
Document Management
File Management
Communicating With Other Applications
Custom Drawing and Animation
Internationalization
Editing Support
Printing
Help
Plug-in Architecture
Adopting Objective-C
Learn the Objective-C Language
Learn the Cocoa Class Hierarchy
Learn Memory Management in Cocoa
Revision History