Available:*
Library | Call Number | Status |
---|---|---|
Searching... R.H. Stafford Library (Woodbury) | 005.117 HIL | Searching... Unknown |
Bound With These Titles
On Order
Summary
Summary
Want to write iOS apps or desktop Mac applications? This introduction to programming and the Objective-C language is your first step on the journey from someone who uses apps to someone who writes them.
Based on Big Nerd Ranch's popular Objective-C Bootcamp, Objective-C Programming: The Big Nerd Ranch Guide covers C, Objective-C, and the common programming idioms that enable developers to make the most of Apple technologies. Compatible with Xcode 5, iOS 7, and OS X Mavericks (10.9), this guide features short chapters and an engaging style to keep you motivated and moving forward. At the same time, it encourages you to think critically as a programmer.
Here are some of the topics covered:
Using Xcode, Apple's documentation, and other tools Programming basics: variables, loops, functions, etc. Objects, classes, methods, and messages Pointers, addresses, and memory management with ARC Properties and Key-Value Coding (KVC) Class extensions Categories Classes from the Foundation framework Blocks Delegation, target-action, and notification design patterns Key-Value Observing (KVO) Runtime basicsAuthor Notes
Aaron Hillegass, a former employee at NeXT and Apple, has nearly two decades experience programming and teaching Objective-C, Cocoa, and, more recently, iOS. Aaron is the author of Cocoa Programming for Mac OS X and co-author of iOS Programming: The Big Nerd Ranch Guide. In 2001, Aaron founded Big Nerd Ranch and began developing intensive courses that teach-programming in a focused, distraction-free environment.
Mikey Ward is a senior iOS and Cocoa instructor at Big Nerd Ranch, Since discovering QuickBASIC in the late 80's, he has enjoyed bossing computers around and now enjoys showing others how to do the same. Mikey also convenes the Atlanta chapter of CocoaHeads, a worldwide group devoted to discussion of Apple's frameworks for writing Mac and iOS applications.
Table of Contents
I Getting Started | p. 1 |
1 You and This Book | p. 3 |
C and Objective-C | p. 3 |
How this book works | p. 4 |
How the life of a programmer works | p. 4 |
2 Your First Program | p. 7 |
Installing Apple's developer tools | p. 7 |
Getting started with Xcode | p. 7 |
Where do I start writing code? | p. 9 |
How do I run my program? | p. 14 |
So, what is a program? | p. 15 |
Don't stop | p. 16 |
II How Programming Works | p. 19 |
3 Variables and Types | p. 21 |
Types | p. 21 |
A program with variables | p. 22 |
Challenge | p. 24 |
4 if/else | p. 25 |
Boolean variables | p. 27 |
When curly braces are optional | p. 27 |
else if | p. 27 |
For the more curious: conditional operators | p. 28 |
Challenge | p. 28 |
5 Functions | p. 29 |
When should I use a function? | p. 29 |
How do I write and use a function? | p. 29 |
How functions work together | p. 31 |
Standard libraries | p. 32 |
Local variables, frames, and the stack | p. 33 |
Scope | p. 34 |
Recursion | p. 35 |
Looking at frames in the debugger | p. 38 |
return | p. 40 |
Global and static variables | p. 41 |
Challenge | p. 42 |
6 Format Strings | p. 43 |
Using tokens | p. 43 |
Escape sequences | p. 44 |
Challenge | p. 45 |
7 Numbers | p. 47 |
Integers | p. 47 |
Tokens for displaying integers | p. 48 |
Integer operations | p. 49 |
Floating-point numbers | p. 52 |
Tokens for displaying floating-point numbers | p. 52 |
The math library | p. 52 |
Challenge | p. 53 |
A note about comments | p. 53 |
8 Loops | p. 55 |
The while loop | p. 56 |
The for loop | p. 57 |
break | p. 58 |
continue | p. 59 |
The do-while loop | p. 60 |
Challenge: counting down | p. 60 |
Challenge: user input | p. 61 |
9 Addresses and Pointers | p. 65 |
Getting addresses | p. 65 |
Storing addresses in pointers | p. 66 |
Getting the data at an address | p. 67 |
How many bytes? | p. 67 |
NULL | p. 68 |
Stylish pointer declarations | p. 69 |
Challenge: how much memory? | p. 70 |
Challenge: how much range? | p. 70 |
10 Pass-By-Reference | p. 71 |
Writing pass-by-reference functions | p. 72 |
Avoid dereferencing NULL | p. 74 |
Challenge | p. 74 |
11 Structs | p. 75 |
Challenge | p. 77 |
12 The Heap | p. 79 |
III Objective-C and Foundation | p. 83 |
13 Objects | p. 85 |
Objects | p. 85 |
Classes | p. 85 |
Creating your first object | p. 86 |
Methods and messages | p. 88 |
Message sends | p. 88 |
Another message | p. 89 |
Class methods vs. instance methods | p. 90 |
Sending bad messages | p. 91 |
A note on terminology | p. 93 |
Challenge | p. 94 |
14 More Messages | p. 95 |
A message with an argument | p. 95 |
Multiple arguments | p. 96 |
Nesting message sends | p. 98 |
alloc and init | p. 99 |
Sending messages to nil | p. 99 |
id | p. 100 |
Challenge | p. 100 |
15 Objects and Memory | p. 103 |
On pointers and their values | p. 103 |
Memory management | p. 105 |
ARC | p. 106 |
16 NSString | p. 109 |
Creating instances of NSString | p. 109 |
NSString methods | p. 109 |
Class references | p. 110 |
Other parts of the documentation | p. 116 |
Challenge: finding more NSString methods | p. 117 |
Challenge: using readline() | p. 117 |
17 NSArray | p. 119 |
Creating arrays | p. 119 |
Accessing arrays | p. 120 |
Iterating over arrays | p. 123 |
NSMutableArray | p. 125 |
Old-style array methods | p. 126 |
Challenge: a grocery list | p. 127 |
Challenge: interesting names | p. 127 |
18 Your First Class | p. 129 |
Accessor methods | p. 133 |
Accessor naming conventions | p. 133 |
self | p. 134 |
Multiple files | p. 134 |
Class prefixes | p. 134 |
Challenge | p. 135 |
19 Properties | p. 137 |
Declaring properties | p. 137 |
Property attributes | p. 138 |
Dot notation | p. 139 |
20 Inheritance | p. 141 |
Overriding methods | p. 144 |
super | p. 145 |
Inheritance hierarchy | p. 146 |
description and %@ | p. 147 |
Challenge | p. 148 |
21 Object Instance Variables and Properties | p. 151 |
Object ownership and ARC | p. 153 |
Creating the BNRAsset class | p. 154 |
Adding a to-many relationship to BNREmployee | p. 155 |
Challenge: holding portfolio | p. 159 |
Challenge: removing assets | p. 160 |
22 Class Extensions | p. 161 |
Hiding mutability | p. 162 |
Headers and inheritance | p. 163 |
Headers and generated instance variables | p. 164 |
Challenge | p. 164 |
23 Preventing Memory Leaks | p. 165 |
Strong reference cycles | p. 167 |
Weak references | p. 170 |
Zeroing of weak references | p. 171 |
For the More Curious: manual reference counting and ARC history | p. 173 |
Retain count rules | p. 174 |
24 Collection Classes | p. 177 |
NSSet/NSMutableSet | p. 177 |
NSDictionary/NSMutableDictionary | p. 180 |
Immutable objects | p. 183 |
Sorting arrays | p. 184 |
Filtering | p. 185 |
Collections and ownership | p. 186 |
C primitive types | p. 186 |
Collections and nil | p. 187 |
Challenge: reading up | p. 187 |
Challenge: top holdings | p. 187 |
Challenge: sorted holdings | p. 187 |
25 Constants | p. 189 |
Preprocessor directives | p. 190 |
#include and #import | p. 191 |
#define | p. 191 |
Global variables | p. 192 |
enum | p. 193 |
#define vs. global variables | p. 195 |
26 Writing Files with NSString and NSData | p. 197 |
Writing an NSString to a file | p. 197 |
NSError | p. 198 |
Reading files with NSString | p. 200 |
Writing an NSData object to a file | p. 200 |
Reading an NSData from a file | p. 202 |
Finding special directories | p. 202 |
27 Callbacks | p. 205 |
The run loop | p. 206 |
Target-action | p. 206 |
Helper objects | p. 209 |
Notifications | p. 212 |
Which to use? | p. 214 |
Callbacks and object ownership | p. 214 |
For the more curious: how selectors work | p. 215 |
28 Blocks | p. 217 |
Using blocks | p. 218 |
Declaring a block variable | p. 218 |
Composing a block | p. 219 |
Passing in a block | p. 220 |
typedef | p. 222 |
Blocks vs. other callbacks | p. 223 |
More on blocks | p. 223 |
Return values | p. 223 |
Anonymous blocks | p. 224 |
External variables | p. 224 |
Challenge: an anonymous block | p. 227 |
Challenge: using a block with NSNotificationCenter | p. 227 |
29 Protocols | p. 229 |
Calling optional methods | p. 231 |
30 Property Lists | p. 233 |
Challenge | p. 236 |
IV Event-Driven Applications | p. 237 |
31 Your First iOS Application | p. 239 |
GUI-based applications | p. 239 |
Getting started with iTahDoodle | p. 240 |
BNR AppDelegate | p. 241 |
Model-View-Controller | p. 242 |
The application delegate | p. 244 |
Setting up views | p. 245 |
Running on the iOS simulator | p. 248 |
Wiring up the button | p. 249 |
Wiring up the table view | p. 251 |
Saving and loading data | p. 255 |
Adding a C helper function | p. 255 |
Saving task data | p. 256 |
Loading task data | p. 256 |
For the more curious: what about main()? | p. 257 |
For the more curious: running iTahDoodle on a device | p. 257 |
32 Your First Cocoa Application | p. 259 |
Getting started with TahDoodle | p. 260 |
Setting up views in Interface Builder | p. 262 |
Setting up the button | p. 263 |
Setting up the table view | p. 265 |
Adding autolayout constraints | p. 268 |
Making connections | p. 270 |
File's Owner | p. 270 |
Setting the button's target-action pair | p. 271 |
Connecting the table view | p. 273 |
Implementing NSTableViewDataSource | p. 275 |
Saving and loading data | p. 277 |
Challenge | p. 278 |
V Advanced Objective-C | p. 279 |
33 init | p. 281 |
Writing init methods | p. 281 |
A basic init method | p. 282 |
instancetype | p. 282 |
Using and checking the superclass initializer | p. 283 |
init methods that take arguments | p. 283 |
Using accessors | p. 285 |
Multiple initializers | p. 286 |
Deadly init methods | p. 289 |
34 More about Properties | p. 291 |
More on property attributes | p. 291 |
Mutability | p. 291 |
Lifetime specifiers | p. 291 |
Advice on atomic vs. nonatomic | p. 294 |
Implementing accessor methods | p. 294 |
35 Key-Value coding | p. 297 |
Non-object types | p. 299 |
Key paths | p. 299 |
36 Key-Value Observing | p. 301 |
Using the context in KVO | p. 302 |
Triggering the notification explicitly | p. 303 |
Dependent properties | p. 304 |
37 Categories | p. 305 |
Challenge | p. 306 |
VI Advanced C | p. 307 |
38 Bitwise Operations | p. 309 |
Bitwise-OR | p. 310 |
Bitwise-AND | p. 311 |
Other bitwise operators | p. 312 |
Exclusive-OR | p. 312 |
Complement | p. 313 |
Left-shift | p. 313 |
Right-shift | p. 314 |
Using enum to define bit masks | p. 314 |
More bytes | p. 315 |
Challenge | p. 315 |
39 C Strings | p. 317 |
char | p. 317 |
char * | p. 318 |
String literals | p. 321 |
Converting to and from NSString | p. 322 |
Challenge | p. 322 |
40 C Arrays | p. 323 |
Challenge | p. 325 |
41 Running from the Command Line | p. 329 |
Command-line arguments | p. 330 |
More convenient running from the command-line | p. 333 |
42 Switch Statements | p. 335 |
Appendix: The Objective-C Runtime | p. 337 |
Introspection | p. 337 |
Dynamic method lookup and execution | p. 337 |
Management of classes and inheritance hierarchies | p. 338 |
How KVO works | p. 342 |
Final notes | p. 344 |
Challenge: instance variables | p. 344 |
Next Steps | p. 345 |
Index | p. 347 |