: David Mark, Jeff LaMarche, Jack Nutting
: Learn Cocoa on the Mac
: Apress
: 9781430218609
: 1
: CHF 31.30
:
: Allgemeines, Lexika
: English
: 400
: Wasserzeichen/DRM
: PC/MAC/eReader/Tablet
: PDF

The Cocoa frameworks are some of the most powerful frameworks for creating native desktop applications available on any platform today, and Apple gives them away, along with the Xcode development environment, for free! However, for a first-time Mac developer, just firing up Xcode and starting to browse the documentation can be a daunting task. The Objective-C class reference documentation alone would fill thousands of printed pages, not to mention all the other tutorials and guides included with Xcode. Where do you start? Which classes are you going to need to use? How do you use Xcode and the rest of the tools?

This book answers these questions and more, helping you find your way through the jungle of classes, tools, and new concepts so that you can get started on the next great Mac OS X applicationtoday.Jack Nutting is your guide through this forest; he's lived here for years, and he'll show you which boulder to push, which vine to chop, and which stream to float across in order to make it through. You will learn not only how to use the components of this rich framework, but also which of them fit together, and why.

Jack Nutting's approach, combining pragmatic problem-solving with a deep respect for the underlying design philosophies contained within Cocoa, stems from years of experience using these frameworks. He'll show you which parts of your application require you to jump in and code a solution, and which parts are best served by letting Cocoa take you where it wants you to go. The path over what looks like a mountain of components and APIs has never been more thoroughly prepared for your travels. With Jack's guidance, the steep learning curve becomes a pleasurable adventure. There is still much work for the uninitiated, but by the time you're done, you will be well on your way to becoming a Cocoa master.



Dave Mark is a longtime Mac developer and author who has written a number of books on Mac and iOS development, including Beginning iPhone 4 Development (Apress, 2010), More iPhone 3 Development (Apress, 2010), Learn C on the Mac (Apress, 2008), The Macintosh Programming Primer series (Addison-Wesley, 1992), and Ultimate Mac Programming (Wiley, 1995). Dave loves the water and spends as much time as possible on it, in it, or near it. He lives with his wife and three children in Virginia.
Title Page1
Copyright Page2
Contents at a Glance3
Table of Contents4
Foreword10
About the Authors11
About the Technical Reviewer12
Acknowledgments13
Preface14
Chapter 1 Must Love Cocoa15
Get a Mac and Download the Tools16
Download the Source Code17
Getting Help17
What You Need to Know Before You Begin17
Are You Ready?18
Chapter 2 Hello, World19
Building Hello, World 19
Exploring the Nib File23
The Library24
Dragging Out a Label26
Using the Blue Guidelines27
The Inspector Window28
The Attributes Inspector29
Change the Label s Color and Font31
Using the Menu Editor33
Creating Your Application Icon35
Adding Your Icon to Your Project36
Property Lists39
Running Your Application39
Sharing Your Creation With the World40
Goodbye, Hello World42
Chapter 3 Lights, Camera Actions! (and Outlets, Too)43
This Chapter s Application44
Frameworks, Frameworks Everywhere44
The Foundation Framework45
The AppKit Framework45
The Cocoa Way: Model-View-Controller46
Outlets, Actions, and Controllers47
Declaring Outlets47
Declaring Actions48
Outlets and Actions in Action49
Enabling Garbage Collection49
Creating Our Controller Class51
Declaring an Action and Outlet52
Back to Interface Builder53
Proxy Objects54
Creating the Controller Instance55
Setting Up the Window56
Designing the Window s Interface60
Connecting the Outlet62
Connecting the Buttons to Our Action63
Implementing the Action Method64
The Application Delegate65
Configuring the Application to Quit on Window Close66
Using the Documentation Browser67
Bring It on Home68
Chapter 4 GUI Components69
Creating the VillainTracker Application71
Creating the VillainTrackerAppDelegate Class72
Planning for the GUI74
Building Your Interface76
Bringing Out Your Text Fields76
Letting them Pick Dates78
Creating the Combo Box79
Indicating a Rating with a Level Indicator80
Adding Radio Buttons in a Matrix81
Adding an Image View84
Adding Checkboxes in a Matrix85
Configuring a Popup Button86
Inserting a Text View87
Making Logical Groupings87
Resizing90
Time for the Controller92
Making All the Connections92
Getting Started with Coding94
Standardizing Key Names94
Creating the Default Villain95
Paying Attention to Detail96
Setting Simple Values97
Values in Complex Controls98
Responding to Input101
In Conclusion104
Chapter 5 Using Table Views105
Preparing AppController for Multiple Villains105
Making Way for the Table View107
Tweaking the Autosizing Characteristics110
Making Some New Connections112
Making Way for the Table View: Code Edition113
The Table View Needs Your Help114
Adding and Deleting Villains116
In Conclusion118
Chapter 6 Cocoa Bindings119
Binding to Simple Controls120
Create the DungeonThing Project120
Create a Preferences Window121
Add a Tab View122
Character Generation Preferences122
Monster Generation Preferences124
Dungeon Generation Preferences124
Binding to NSUserDefaultsController125
Bindings for Character Generation125
Bindings for Monster Generation127
Bindings for Dungeon Generation127
Create the Main Window128
Set Up the DungeonThingAppDelegate130
Define Your Constants130
Specify Default Preferences Values131
Create the Action Methods132
Binding to a Table View134
Make the Code Bindings-Ready135
Show History in Tables138
Dealing With Inconsistencies in Nib Files138
Configuring the Table Views and Text Views138
Create and C