Sams Teach Yourself Cocoa Touch Programming in 24 Hours [NOOK Book]

Overview

In Full Color

Code samples are syntax highlighted as in Xcode!!

In just 24 sessions of one hour or less, learn how to build powerful mobile applications with Apple’s Cocoa Touch technology for the iPhone and iPod touch! Using this book’s straightforward, step-by-step approach, you’ll master every skill and technology you need, from handling user interaction and building effective user interfaces to accessing the Internet, playing media, and ...

See more details below
Sams Teach Yourself Cocoa Touch Programming in 24 Hours

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99
BN.com price
(Save 43%)$31.99 List Price

Overview

In Full Color

Code samples are syntax highlighted as in Xcode!!

In just 24 sessions of one hour or less, learn how to build powerful mobile applications with Apple’s Cocoa Touch technology for the iPhone and iPod touch! Using this book’s straightforward, step-by-step approach, you’ll master every skill and technology you need, from handling user interaction and building effective user interfaces to accessing the Internet, playing media, and using the iPhone and iPod touch’s incredible sensing capabilities. Each lesson builds on what you’ve already learned, giving you a rock-solid foundation for real-world success!

Step-by-step instructions carefully walk you through the most common Cocoa Touch programming tasks.

Quizzes and Exercises at the end of each chapter help you test your knowledge.

By the Way notes present interesting information related to the discussion.

Did You Know? tips offer advice or show you easier ways to perform tasks.

Watch Out! cautions alert you to possible problems and give you advice on how to avoid them.

  • Write simple, efficient code that reflects a clear understanding of how Cocoa Touch works and why it works that way
  • Build great iPhone/iPod touch user interfaces from the ground up
  • Display tables and provide for clear navigation
  • Access the Internet and networks and show web pages
  • Save and retrieve data, including user preferences
  • Understand how the Cocoa Touch runtime loop interacts with your application
  • Draw and manipulate images
  • Create complex animations such as Cover Flow
  • Build applications that play and record media
  • Use the iPhone’s built-in accelerometer, GPS capabilities, and WiFi support
  • Share data via custom URLs, emails, and other techniques
  • Find and fix common Cocoa Touch software bugs, fast
  • Avoid the performance bottlenecks that affect Cocoa Touch code
Read More Show Less

Product Details

  • ISBN-13: 9780768695564
  • Publisher: Pearson Education
  • Publication date: 10/29/2009
  • Series: Sams Teach Yourself Series
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 576
  • Sales rank: 1,143,710
  • File size: 25 MB
  • Note: This product may take a few minutes to download.

Meet the Author

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).

Read More Show Less

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

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)