rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780321832085

Learning Objective-C 2.0 A Hands-on Guide to Objective-C for Mac and iOS Developers

by
  • ISBN13:

    9780321832085

  • ISBN10:

    0321832086

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2012-11-14
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

List Price: $39.99 Save up to $10.00
  • Buy Used
    $29.99

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

Summary

Fully updated for Apple's latest improvements, Learning Objective-C 2.0, Second Editionwill help any new Objective-C programmer get productive fast. Long-time OS X and iOS developer Robert Clair first reviews the essential object and C concepts that all Objective-C developers need to know. Next, he introduces the basics of the language, walking through code examples one line at a time, and explaining what's happening "behind the scenes." He progresses to increasingly sophisticated techniques in areas ranging from frameworks and security to memory management - all carefully chosen for their value in real-world, day-to-day programming. This edition's extensive new coverage includes: * A clear and practical introduction to Apple's new ARC memory management (including when and when not to use it) * Expanded and improved coverage of blocks * Xcode 4.2, the LLVM compiler, and the LLDB debugger This is the perfect entry-level guide for Objective-C newcomers. Readers who complete it can move on to Stephen Kochan's highly-regarded Programming in Objective-C 2.0, and to our more specialized Apple development titles, such as David Chisnall's Cocoa Programming Developer's Handbook, Fritz Anderson's Xcode 4 Unleashed, Second Edition," and Aaron Hillegass's Cocoa Programming for Mac OS X, Fourth Edition.

Author Biography

Robert Clair has been doing OS X development for more than ten years and iOS development since the original iOS SDK became available. He writes apps for his own company, Chromatic Bytes, LLC, and is also a leading OS X and iOS contract developer who specializes in the complete design and coding of graphics intensive programs, and in repairing defective Objective-C code. He recently served as lead programmer for The Street’s iPad app, and for Heritage Associates’ iPad auction catalog. Through Chromatic Bytes, he created the innovative iOS apps ZeusDraw Mobile and Orfeo. He holds a Ph.D. in experimental physics from the University of California, Berkeley.

Table of Contents


 



Dedication

Acknowledgements

About the Author

Preface

 

Part I: Introduction to Objective-C

 

Chapter 1: C, The Foundation of Objective-C

The Structure of a C Program

Variables

Operators

Expressions and Statements

Program Flow

Preprocessor

Command Line Compiling and Debugging

Summary

Exercises

 

Chapter 2: More About C Variables

Memory Layout of a C Program

Automatic Variables

External Variables

Declaration Keywords

Scope

Dynamic Allocation

Summary

Exercises

 

Chapter 3: An Introduction to Object-Oriented Programming

Object-Oriented Programming

An Introduction to Objective-C

Objective-C Additions

Summary

 

Chapter 4: Your First Objective-C Program

Building with Xcode

Objective-C Program Structure

An Object-Oriented Hello World

main.m

Summary

Exercises

 

Part II: Language Basics

 

Chapter 5: Messaging

Methods

Messaging

Messaging Details

Under the Hood

Message Forwarding

Efficiency

Introspection and Other Runtime Fun

Summary

Exercises

 

Chapter 6: Classes and Objects

Defining a Class

Subclassing a Class

Creating Objects

Destroying Objects

Copying Objects

Summary

Exercises

 

Chapter 7: The Class Object

Class Objects

Other Class Methods

Mimicking Class Variables

Summary

Exercises

 

Chapter 8: Frameworks

What Is a Framework?

Cocoa And Cocoa Touch

AppKit

UIKit

Core Foundation

Core Graphics

Core Animation

Other Apple-Supplied Frameworks

Third-Party Frameworks

Under the Hood

Summary

 

Chapter 9: Common Foundation Classes

Immutable and Mutable Classes

Class Clusters

NSString

Collection Classes

NSNumber

NSNull

NSData

NSURL

Objective-C Literals and Object Subscripting

Structures

Geometry Structures on iOS

Summary

Exercises

 

Chapter 10: Control Structures in Objective C

if Statements

for Statements and Implicit Loops

while Statements and NSEnumerator

Fast Enumeration

An Example Using Fast Enumeration

Exceptions

Summary

Exercises

 

Chapter 11: Categories, Extensions, and Security

Categories

Associative References

Extensions

Hiding your Instance Variable Declarations

Instance Variable Scope (Access Control)

Access Control for Methods

Namespaces

Security

Calling C Functions from Objective-C

Summary

Exercises

 

Chapter 12: Properties

Accessing Instance Variables Outside of an Object (Don’t Do It)

Declaring and Implementing Accessors

Accessors Using Properties

Synthesized Instance Variables

@synthesize by Default

Synthesis Summary

Private Properties

The @property Statement

More About @dynamic

Properties without Instance Variables

Properties and Memory Management

A Look Ahead at Automatic Reference Counting (ARC)

Subclassing and Properties

Hidden Setters for readonly Properties

Properties as Documentation

Dot Syntax

Summary

Exercises

 

Chapter 13: Protocols

Protocols

Using Protocols

TablePrinter Example

Protocol Objects and Testing for Conformance

Summary

Exercises

 

Part III: Advanced Concepts

 

Chapter 14: Memory Management Overview

The Problem

The Solutions: Objective-C Memory Management

Onward

 

Chapter 15: Reference Counting

Reference Counting Basics

Receiving Objects

Ownership

dealloc

Returning Objects

retainCount

Multithreading

When Retain Counts Go Bad

Retain Cycles

The Final Goodbye: When Programs Terminate

Summary

Exercises

 

Chapter 16: ARC

What ARC is and is not

How ARC Works

ARC Imposes Some Rules

New Variable Qualifiers

Properties

Retain Cycles

ARC and Core Foundation

Casting to and from void*

ARC and Extra Autorelease Pools

ARC and Exceptions

Using ARC

ARC uses runtime functions

More Information

Summary

Exercises

 

Chapter 17: Blocks

Function Pointers

The Trouble with Function Pointers

NSInvocation

Blocks

Some Philosophical Reservations

Summary

Exercises

 

Chapter 18: A Few More Things

Enums with a Fixed Underlying Type

Forward Declarations of Methods in the @implementation Block Are No Longer Needed

Some New Documentation

Summary

Exercises

 

Part IV: Appendices

 

Appendix A: Reserved Words and Compiler Directives

 

Appendix B: Toll-Free Bridged Classes

 

Appendix C: 32- and 64-bit

 

Appendix D: The Fragile Base Class Problem

 

Appendix E: Resources for Objective -C

 

Index

 

 

 

 

 

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program