Update cookies preferences

E-book: Cocoa and Objective-C: Up and Running: Foundations of Mac, iPhone, and iPad Programming

3.50/5 (70 ratings by Goodreads)
  • Format: 416 pages
  • Series: OREILLY
  • Pub. Date: 16-Apr-2010
  • Publisher: O'Reilly Media
  • Language: eng
  • ISBN-13: 9781449390716
  • Format - EPUB+DRM
  • Price: 21,64 €*
  • * the price is final i.e. no additional discount will apply
  • Add to basket
  • Add to Wishlist
  • This ebook is for personal use only. E-Books are non-refundable.
  • Format: 416 pages
  • Series: OREILLY
  • Pub. Date: 16-Apr-2010
  • Publisher: O'Reilly Media
  • Language: eng
  • ISBN-13: 9781449390716

DRM restrictions

  • Copying (copy/paste):

    not allowed

  • Printing:

    not allowed

  • Usage:

    Digital Rights Management (DRM)
    The publisher has supplied this book in encrypted form, which means that you need to install free software in order to unlock and read it.  To read this e-book you have to create Adobe ID More info here. Ebook can be read and downloaded up to 6 devices (single user with the same Adobe ID).

    Required software
    To read this ebook on a mobile device (phone or tablet) you'll need to install this free app: PocketBook Reader (iOS / Android)

    To download and read this eBook on a PC or Mac you need Adobe Digital Editions (This is a free app specially developed for eBooks. It's not the same as Adobe Reader, which you probably already have on your computer.)

    You can't read this ebook with Amazon Kindle

Provides information on using the Cocoa frameworks and Objective-C to write applications for Mac OS X, the iPhone, and the iPad. A well-known Cocoa expert, Stevenson shows readers how to use Apples Cocoa framework and the Objective-C language to build applications for Mac OS X, iPhone, and iPod Touch. Using step-by-step tutorials, hands-on exercises, and clear examples, the book explains how to use Xcode and Interface Builder to develop Cocoa applications, manage user interaction, create user interfaces, and more. Topics include using Objective-C by to create objects and learn memory management; the Model-View-Controller (MVC) method of sharing data between objects; and understanding foundation value classes; and making custom views with AppKit. Annotation ©2010 Book News, Inc., Portland, OR (booknews.com) Learn the tools most essential for building high-quality applications for Mac OS X, iPhone, and iPod touch. This thorough introduction to Apples Cocoa programming environment and its Objective-C language quickly gets you up to speed with step-by-step tutorials, hands-on tasks, and numerous examples. With clear instruction from Scott Stevenson, the Cocoa programmer behind Cocoa Dev Central, youll learn just enough foundation and theory to ground you before jumping right into building applications, managing events, creating GUIs, and more with Cocoa and the Application Kit. You also get skill-building exercises, and key input from a Cocoa expert on the best use of these tools.
Preface xi
1. Setup and First Run 1
Download and Install Xcode
1
Your First Application
4
Create the Interface
7
Run the Finished Application
11
2. Thinking in Code: Basic C 15
How Code Works
15
How to Format Code
17
Variables
20
Types
21
Constants
23
Enumerated Types
24
Typedefs
24
Functions
24
Declaring Functions
28
Example: FirstProgram
28
Displaying Values on the Command Line
29
Compile and Run the Example
32
Scope
34
Static Variables
35
Conditionals
36
Example: ShoppingTrip
39
Compile and Run
41
Wrap Up
42
3. Memory and Pointers: Advanced C 43
Arrays
43
Loops
45
Text Strings
47
Multidimensional Arrays
48
Pointers
49
The Purpose of Pointers
50
Using Pointers
50
Pointers and the const Keyword
52
Dynamic Memory
53
Strings and Dynamic Memory
56
Returning Strings from Functions
57
Arrays of Strings
58
Example: AddressBook
59
Compile and Run the AddressBook Example
61
Structs
62
Header Files
64
Compile and Run the HeaderFileTest Example
66
Create Files for the Song Struct
66
Final Example
68
4. Thinking in Objects 73
Structs and Classes
74
Designing Classes
76
Accessors
77
Inheritance
78
Composition
80
Object Lifetime
81
Built-in Classes
81
5. Basic Objective-C 83
NSString Basics
84
Using Methods
84
Nested Method Calls
86
Multi-Input Methods
86
Accessors
86
Dot Syntax
87
Creating Objects
88
Basic Memory Management
88
Using Autorelease Directly
90
Declaring a Class
90
Add Methods
91
Implementing a Class
92
init
94
dealloc
95
Example: PhotoInfo
96
6. More Objective-C 103
More on Memory Management
103
The Life of an Instance Variable
105
Copying Objects
106
Class Name Prefixes
107
Properties
107
Property Options
109
64-Bit Objective-C
111
Enabling 64-Bit
112
Should I Use 64-Bit?
113
All Further Examples Assume 64-Bit
114
Categories
114
Categories for Private Methods
116
Introspection
118
Protocols
120
Dynamic Messaging
124
Using Selectors to Call Methods
125
Forwarding Messages
126
Exceptions
127
Example: DataCollector
129
Some New Classes and Methods
129
Create the Files
130
Build and Run
136
7. Foundation Value Gasses 137
NSString
138
Ranges and Substrings
140
Using NSString with C Types
141
Comparing Strings for Equality
141
Strings As File Paths
142
Reading and Writing Files with Strings
144
Mutability
148
Advantages of Mutability
149
Advantages of Immutability
150
Core Foundation
150
Memory Management
152
Core Foundation Mutability
153
Toll-Free Bridging
154
Core Foundation Types As Properties
155
Drawbacks of Core Foundation Types
156
Open Source
156
NSNumber
156
CFNumberRef
159
Cocoa Primitive Types
160
NSDecimalNumber
161
NSNumberFormatter
163
When to Use Which Number Type
165
NSData
166
NSMutableData
168
NSArray
169
Fast Enumeration
171
Blocks
171
NSMutableArray
173
CFArrayRef
174
NSIndexSet
175
NSDictionary
177
NSMutableDictionary
178
OFDictionaryRef
179
NSSet
181
NSMutableSet
182
NSValue
183
NSDate
184
CFDateRef
186
8. Bask Controls 189
How to Use This
Chapter
189
Windows and Views
190
Targets and Actions
193
Buttons
194
Declaring Action Methods
195
Connecting Actions
198
Menus
203
Responder Chain
206
Pop-up Buttons
211
Sliders
214
Text Fields
216
Outlets
218
Datasources
222
Table View Datasource Methods
226
Implementing Datasource Methods
227
Bindings
230
Key-Value Protocols
234
Bindings for Simple Controls
236
Bindings for Complex Controls
242
Tips for Debugging Bindings
244
9. Designing Applications Using MVC
247
About This Project
248
Window Controllers
249
View Controllers
250
Core Data
253
Create the Project Files
254
Create the Entities
254
Add Attributes and Relationships
255
Update the App Delegate
261
Add the Quartz Framework
264
Create the Window Controller
264
Create the View Controllers
268
Create the Managed Object Classes
280
Create the User Interface
286
Remove the Default Window
287
Create the Main Window Interface
289
Create the Browser Interface
293
Create the Editor View Interface
297
Create the List View Interface
298
Run the Application
301
Preparing for Release
303
10. Custom Views and Drawing 307
Basic Geometry
308
Geometry Structs As Strings
310
Geometry Structs As NSValues
311
Cocoa View Coordinates
312
Derived Rects
313
Comparison Functions
314
Basic Drawing
315
NSColor
316
Subclassing NSView
316
Instantiate the View
320
The Graphics Context
323
Bezier Paths
324
Drawing Polygons
324
Drawing Curved Paths
325
Images
329
Loading Image Data
329
Drawing Images in a View
331
Shadows
338
Add a Shadow to StyledImageView
338
Gradients
341
Drawing a Gradient Background
342
Drawing an Image Sheen
344
Refactoring View Code
349
Why You Should Refactor
350
Goals for Refactoring
350
Refactored Header
352
Refactored Implementation
354
Test the Refactored Version
359
Text
359
Fonts
359
Attributed Strings
360
Add a Title to StyledImageView
365
Handling Mouse and Keyboard Events
370
Keyboard Events
371
Mouse Events
372
Add Event Support to StyledImageView
372
11. The Final Word 377
The List
377
Websites
378
Last Thought
380
Index 381
Scott Stevenson has been programming with Cocoa for seven years, and runs Cocoa Dev Central, one of the top destinations for programmers who want to learn Cocoa.