cocoa programming

454 441 0
cocoa programming

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... this book focuses on desktop Cocoa and assumes that you’ll find it fairly easy to move from Cocoa development for Mac OS X to developing for the mobile platforms Use the tools that Apple provides for Cocoa development In your old environment, you may have popped open a terminal window and used vi or emacs along with gcc and gdb, or you may have used an IDE like Eclipse For Cocoa app development, use Xcode... Moving In Moving to Cocoa is like moving to a new neighborhood You need to figure out where everything is and get used to the local customs You’ll find that some aspects of developing Cocoa apps for Mac OS X are very similar to what you’ve been doing, while other aspects feel very strange In this book you’ll get a feel for working with the following: • Objective-C: The language of Cocoa development M... is new to the Mac or iPhone platform You understand basic programming concepts but just don’t know how they apply in this setting You know a language that has a structure somewhat like C, but you don’t know ObjectiveC You understand object-oriented programming, just not in this setting You want to learn all the techniques for working with the Cocoa frameworks, but you are comfortable reading the documentation... way that code is structured pretty quickly You also have to get comfortable with the common patterns that Cocoa programmers use In Chapter 3, Methods and Parameters, on page 48, we’ll get you comfortable reading some Objective-C We’ll start with messages because sending messages is the core of Cocoa programming Even experienced object-oriented programmers lose sight of this We tend to think that OO is... code accessible from Xcode You will have an easier time of getting your question answered if you use the lingua franca of Cocoa development For a comprehensive list, visit http://lists.apple.com/ You will probably want to subscribe to the http://lists.apple.com/mailman/listinfo /cocoa- dev list Also look for lists that serve specific areas that you target in your application If you have a specific need... book It’s not a guide for tourists that lists the things you’d want to see if you were only going to live with Cocoa for a day It’s not a comprehensive almanac that lists every API class by class and method by method This is designed to get you through those first weeks and months of moving to Cocoa This is the coding equivalent of finding out where to go for coffee, which streets are safe to walk on at... strange In this book you’ll get a feel for working with the following: • Objective-C: The language of Cocoa development M OVING I N • Xcode, Interface Builder, and Instruments: The tools for Cocoa development • Cocoa: The frameworks full of existing classes created by Apple that will give your applications the features and polish of your favorite Mac OS X applications What, you ask, is a framework?... and are currently running Snow Leopard By the way, if you are a new programmer, start with our book by Tim Isted, Beginning Mac Programming, which is available at http://pragprog.com/titles/tibmac/ name is and find that it is, in fact, correct Once you tune yourself to the Cocoa frameworks, you’ll find that they tend to obey the principle of least surprise: you’ll usually find what you expect to find This... Mac OS X applications if you embrace Objective-C, use the development tools, and take advantage of the Cocoa frameworks You will tend to get much further much more quickly if you use what is provided for you and follow local customs rather than fight with the culture Use Objective-C Sure, you can write Cocoa applications in other languages But for now, learn the native language There is a lot of support... Exploring the Frameworks We’re going to play quite a bit with the Cocoa frameworks When you can, you should use the objects and classes that Apple provides before you struggle to write the code yourself In the beginning, you will find yourself writing a lot of code to do something you’ve seen other applications do on Mac OS X An experienced Cocoa developer will look at your code, make a face, and suggest, . What Readers Are Saying About Cocoa Programming: A Quick-Start Guide for Developers Cocoa Programming is powerful because Daniel Steinberg teaches us the brilliant way Cocoa and Objective C are constructed. granted. In this book, Daniel Steinberg has proven to be such a teacher. Cocoa Programming exposes the beauty of the Cocoa environment with just enough detail and explanation to help you “get it”. Frye Developer, Tasty Cocoa Software LLC If you’r e new to Mac programming or switching from iPhone development, start reading this book now! Cocoa Programming covers topics other books don’t and puts

Ngày đăng: 28/04/2014, 15:53

Mục lục

  • Using What's There

    • Creating Your Project in Xcode

    • Creating the Appearance with Interface Builder

    • Testing the Interface with the Cocoa Simulator

    • Wiring Up the Components

    • Exercise: Rinse and Repeat

    • Methods and Parameters

      • Sending Messages Without Arguments

      • Links Back to Yourself

      • Classes and Objects

        • Creating ``Hello, World!''

        • Logging Output to the Console

        • Using an Existing Class

        • Creating a New Class

        • Creating and Using a Class Method

        • Creating a New Object

        • Instance Variables and Properties

          • Pointers

          • Working with Nonobject Types

          • Converting the Accessors to Properties

          • Finding Leaks with the Clang Static Analyzer

          • Fixing the Memory Leak on Mac OS X

          • Properties and Garbage Collection

          • Finding Leaks in Instruments

Tài liệu cùng người dùng

Tài liệu liên quan