did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780672331251

Sams Teach Yourself Cocoa Touch Programming in 24 Hours

by
  • ISBN13:

    9780672331251

  • ISBN10:

    067233125X

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2009-10-15
  • Publisher: Sams Publishing
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.99
We're Sorry.
No Options Available at This Time.

Summary

The clear, easy, full-color tutorial for everyone who wants to write iPhone/iPod Touch apps - absolutely no Cocoa experience necessary!--The start-to-finish, hands-on introduction to iPhone/iPod Touch Cocoa programming, with up-to-the-minute coverage of the new iPhone 3.0 SDK.-By the creator of two leading iPhone/iPod Touch games.-Teaches every concept with carefully-explained code-A complete, 4-color tutorial: step-by-step instructions, examples, Q and As, quizzes, exercises, tips, shortcuts, and more. In just 24 lessons of one hour or less, Sams Teach Yourself Cocoa Touch DevelopmentHours will help beginning iPhone/iPod Touch developers gain true in 24 mastery with Cocoa mobile application development. Each lesson builds on everything that's come before, helping readers learn all they need to know without ever becoming overwhelmed. In chapter 1, readers will already be starting their first working application. Then, one step at a time, they'll learn how to handle user interaction; build effective user interfaces; add animation; display tables; provide navigation; access the Internet and other networks; display web pages; save, retrieve, and share data; play and record media; sense the world; and debug, optimize, and ship their applications. Along the way, the book illuminates essential Cocoa concepts, explaining why Cocoa works the way it does, so readers can answer more of their own questions and troubleshoot more of their own code. Simple, step-by-step instructions walk readers through the most common questions, issues, and tasks... Q and As, Quizzes, and Exercises help them build and test their knowledge... 'Did You Know?' tips offer insider advice and shortcuts... 'Watch Out!' alerts help them avoid problems. No matter where this book's readers start, by the time they're finished, they'll be comfortable writing real-world, production applications.

Author Biography

Dr. Sengan Baring-Gould earned his Ph.D. in Artificial Intelligence (Natural Language Processing) and has published a number of papers in this field. Prior to that, he wrote a seminal series of articles reverse engineering the video hardware of the Atari ST, which are still quoted today. He has coauthored two patents in the field of x86 debugging hardware.

 

He is the owner of Ansemond LLC, a small Mac and iPhone software company based in Colorado. Its current products include Tetratile (an iPhone puzzle board game) and Find It! Keep It! (a Mac web browser that captures web pages reliably and saves them to a fully searchable database).

Table of Contents

Introduction     1

About This Book     1

About You     2

About Objective-C     2

What You Need     2

How to Read This Book     3

Conventions Used in This Book     3

PART I: Understanding the Objective-C Language

HOUR 1: Starting Your First Application: A Calculator     5

Setting Up Your Development Tools     5

Using Xcode     6

Using Interface Builder     13

Summary     20

Workshop     21

Exercise      21

HOUR 2: Handling Interaction     23

Objective-C     23

Binding an Object to the User Interface     31

Basic Memory Management     39

Invoking Methods on nil     41

Type Checking Rules     41

Type Equivalence     42

Type Checking     42

Summary     44

Q&A     45

Workshop     45

Exercise     46

HOUR 3: Simplifying Your Code     47

Managing Memory with NSAutoReleasePools     47

Objective-C Strings     52

Introducing the Debugger      62

Understanding Messaging      65

Debugging a Real Bug     68

Using Shorthands     70

Summary     74

Q&A     74

Workshop     74

Exercises     75

HOUR 4: Making the Calculator Calculate     77

A Simple Calculator     78

Mutable Classes: Making a “Printing” Calculator     82

Dynamic Objective-C     88

Summary     96

Q&A     96

Workshop     96

Exercises     97

HOUR 5: Adding Variables to the Calculator     99

A Better Model/Controller Split      99

Using an NSDictionary to Add Variables to the Calculator     106

The Key-Value Coding and Observing Protocols     113

Summary     120

Workshop     120

Exercise     121

PART II: User-Interface Foundations

HOUR 6: Understanding How the User Interface Is Built     123

User-Interface Building-Blocks: Views     123

Building the UI from Views     136

Summary     147

Q&A     147

Workshop      148

Exercise     148

HOUR 7: Understanding How Events Are Processed     149

Run Loops and Core Foundation     149

How Cocoa Uses the Run Loop     155

Touch Event Dispatching     160

Summary     167

Q&A     168

Workshop     168

Exercises     169

HOUR 8: Drawing User-Interface Elements      171

Adding Images to UIButton     171

Core Graphics     178

Drawing Your Own Button     194

Summary     199

Q&A     199

Workshop     199

Exercises     200

HOUR 9: Layers and Core Animation: Creating a Cover Flow Clone     201

Placing Layers in 3D Space     202

Using Core Animation     208

Creating a Cover Flow Clone     220

Summary     230

Q&A     230

Workshop     231

Exercises     231

PART III: Advanced User-Interface Elements

HOUR 10 : Using View Controllers     233

View Controllers     233

Adding a Scientific Mode to the Calculator     242

Summary     250

Q&A     250

Workshop     251

Exercises     252

HOUR 11 : Displaying Tables     253

Creating Tables      254

Using Table Cells     261

Creating a Twitter Application     268

Summary     272

Q&A     273

Workshop     273

Exercises     274

HOUR 12 : Adding Navigation and Tab Bar Controllers     275

Using Modal View Controllers     275

Saving Application Defaults     279

Using Tab Bars     283

Using Navigation Bars     287

Summary     295

Q&A     295

Workshop     295

Exercises     296

HOUR 13 : Adding Undo and Redo Functionality     297

Creating Your Own Undo/Redo Manager     297

Using NSUndoManager     305

Summary     307

Q&A     307

Workshop     308

Exercise      308

PART IV: Accessing the Internet

HOUR 14 : Accessing the Network      309

How Networks Work     309

How the Web Works     316

Using Cocoa Touch to Access the Web     321

Making the Twitter Application Deal with Errors     328

Summary     330

Q&A     331

Workshop     331

Exercises     332

HOUR 15 : Showing a Web Page     335

Understanding UIWebView     335

Using UIWebViews     339

Using WebKit Extensions     345

Summary     352

Q&A     352

Workshop     353

Exercises     354

PART V: Saving and Retrieving Data

HOUR 16 : Adding Application Preferences     355

Retrieving Settings Set by the Settings Application     356

Creating a Settings Bundle for the Settings Application     357

Dynamically Updating Data from the Network     365

Summary     368

Q&A     369

Workshop     369

Exercises     370

HOUR 17 : Using the SQLite Database     371

Saving and Reading Data from Files     371

Saving and Reading Data from an SQLite Database     373

Summary     385

Q&A     385

Workshop     385

Exercise     386

HOUR 18 : Using Core Data     387

Using NSSortDescriptor and NSPredicate     387

Using Core Data     390

Using Xcode to Design Objects     404

Summary     407

Q&A     407

Workshop     407

Exercises     408

PART VI: Interacting with the World

HOUR 19 : Playing and Recording Media     409

Playing and Recording Audio     409

Playing Video Files     426

Summary     429

Q&A     430

Workshop     430

Exercises     431

HOUR 20 : Sensing the World     433

Using the iPhone’s Accelerometer     433

Determining the iPhone’s Location     438

Taking Photos and Making Short Videos     444

Summary     446

Q&A     446

Workshop     446

Exercises     447

HOUR 21 : Sharing Data     449

Using Custom URLs     449

Using Pasteboards     452

Exporting Data     455

Summary     459

Q&A     459

Workshop     460

Exercises     461

PART VII: Completing Your Application

HOUR 22 : Debugging     463

Using gdb, dtrace, valgrind, and nib2objc     463

Resolving Cocoa Misunderstandings     472

Summary     477

Q&A     477

Workshop     477

Exercise     478

HOUR 23 : Optimizing Performance     79

Profiling Your Code     . 479

Optimizing Your Memory Usage     486

Optimizing Your Code’s Speed     495

Summary     500

Q&A     500

Workshop     501

Exercise     502

HOUR 24 : Shipping Your Application     503

Polishing Your Application for Submission     503

Localizing Your Application     506

Submitting Your Application to the App Store     514

Summary     517

Q&A     518

Workshop     519

Exercise     520

APPENDIX A: C Primer (Online)      521

Functions     521

Primitive Types     521

Basic Operators     522

Function Signatures     522

Interface Files     522

System Libraries     522

Composite Structures     523

Memory Access     523

Arrays     524

Dynamic Memory Allocation     524

Strings     524

Types     525

New Kinds of Errors     525

APPENDIX B: Troubleshooting Xcode (Online)      527

Logging in to the Developer Website     527

Obtaining Permission to Upload Your Application to Your Device     529

Building Your Application to Run on a Device     531

Updating Mobile Provisions      533

Debugging the Ambiguous Matches Error     534

Uploading Your Application to Your Device     534

Checking Changes That Do Not Show Up     540

Checking the App Store Executable     541

APPENDIX C: Resources     543

This Book’s Website     543

Books and Papers     543

Web Resources     545

APPENDIX D: Advanced Topics (Online)      547

Testing String Mutability with Exceptions     547

Uncaught Exceptions     547

The Implementation of Exceptions.      548

NSZones     549

Creating Singletons by Overriding allocWithZone:      550

Extending Objects by Overriding allocWithZone:      551

How Applications Start     552

Threads     553

pthreads     554

NSThreads     555

Deciding Whether to Use Threading or One-Shot Invocation     560

Types of Layers     562

View Controller Hierarchy Used in the Twitter Application     566

Index      567

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