Print this page Share

iOS 6 Programming Pushing the Limits: Advanced Application Development for Apple iPhone, iPad and iPod Touch

ISBN: 978-1-118-44995-0
552 pages
December 2012
iOS 6 Programming Pushing the Limits: Advanced Application Development for Apple iPhone, iPad and iPod Touch (1118449959) cover image


Learn to build extraordinary apps for iPhone, iPad, and iPod touch

iOS is the hottest development platform around, and iOS 6 adds a new and deeper dimension to explore. This guide offers serious information for serious programmers who know the basics and are ready to dive into the advanced features of iOS. You'll learn to create killer apps for the iPad, iPhone, and iPod touch, including how to maximize performance and make more money from your apps with in-app purchases. Topics covered include security, multitasking, running on multiple platforms, blocks and functional programming, advanced text layout, and much more.

  • App development for iPhones and iPads is a lucrative and exciting venture; books on this topic are steady bestsellers
  • This advanced guide helps experienced developers take full advantage of the latest platform upgrade, iOS 6
  • Provides in-depth background on maximizing your apps with Apple's iPhone SDK 6.0, including the major new APIs and building applications for the new iPad
  • Covers keeping control of multitasking, increasing income with in-app purchases, key value observing with Cocoa, running on multiple platforms, advanced text layout, building a Core foundation, and more

iOS 6 Programming: Pushing the Limits gives experienced mobile developers a wealth of knowledge for creating outstanding iPhone and iPad apps on the latest platform.

See More

Table of Contents

Introduction 1

Who This Book Is For  1

What This Book Covers 1

What Is New in This Edition 1

How This Book Is Structured 2

What You Need to Use This Book 5

Finding Apple Documentation 5

Source Code 5

Errata 6

Part I: What’s New? 7

Chapter 1 The Brand New Stuff 9

What’s New 9

Summary 13

Further Reading 14

Chapter 2 Getting Comfortable with Xcode 4 and the LLVM Compiler 15

Getting to Know the User Interface 16

All in One Window 18

Navigating the Navigators 19

Help from Your Assistant 21

Integrated Interface Builder 21

LLVM Compiler: A Tryst with the Brain 23

What’s New in LLVM 4 23

Git Your Versions Here 27

Schemes 29

Build Configurations You Can Comment 31

Migrating Your Code to Objective-C ARC 32

Xcode 4 Organizer 34

Summary 35

Further Reading 35

Part II: Getting the Most Out of Everyday Tools 37

Chapter 3 Everyday Objective-C 39

Naming Conventions 39

Automatic Reference Counting 41

Properties 44

Accessors 47

Categories and Extensions48

Formal and Informal Protocols 52

Summary 54

Further Reading54

Chapter 4 Hold On Loosely: Cocoa Design Patterns 55

Understanding Model-View-Controller    55

Understanding Delegates and Data Sources   58

Working with the Command Pattern 59

Working with the Observer Pattern 67

Working with the Singleton Pattern 70

Summary 72

Further Reading 73

Chapter 5 Memory Management with Objective-C ARC 75

Introduction to Objective-C ARC 75

What Is ARC? 76

Common ARC Migration Errors 83

Summary 86

Further Reading 86

Chapter 6 Getting Table Views Right   89

UITable View Class Hierarchy 89

Understanding Table Views 90

Summary 102

Further Reading 103

Chapter 7 Great at Any Angle: Collection Views and Auto Layout 105

Collection Views 105

Cocoa Auto Layout 116

Summary 123

Further Reading 123

Chapter 8 Better Drawing 125

iOS’s Many Drawing Systems 125

UIKit and the View Drawing Cycle 126

View Drawing Versus View Layout 128

Custom View Drawing 129

Optimizing UIView Drawing 144

CGLayer 148

Summary 150

Further Reading 150

Chapter 9 Layers Like an Onion: Core Animation  151

View Animations 151

Managing User Interaction 153

Drawing with Layers 154

Moving Things Around 158

Into the Third Dimension 164

Decorating Your Layers 168

Auto-Animate with Actions 170

Animating Custom Properties 171

Core Animation and Threads 173

Summary 173

Further Reading 173

Chapter 10 Tackling Those Pesky Errors 175

Error-Handling Patterns 175

Assertions 176

Exceptions 178

Catching and Reporting Crashes 179

Errors and NSError 180

Error Handler Blocks 182

Logs 183

Summary 185

Further Reading 186

Chapter 11 Location Services: Know Where You Are 187

Core Location Framework 187

Background Location 191

Location Simulation 194

Keeping an Eye on the Battery 195

Summary 195

Further Reading 195

Part III: The Right Tool for the Job 197

Chapter 12 Common UI Paradigms Using Table Views 199

Pull-To-Refresh 199

Infinite Scrolling 202

Inline Editing and Keyboard 204

Animating a UITableView  206

Practical Implementations of Table View Animations 208

Summary 211

Further Reading 212

Chapter 13 Controlling Multitasking 213

Best Practices for Backgrounding: With Great Power

Comes Great Responsibility 213

When We Left Our Heroes: State Restoration 215

Introduction to Multitasking and Run Loops 223

Developing Operation-Centric Multitasking 224

Multitasking with Grand Central Dispatch  229

Summary 235

Further Reading 236

Chapter 14 REST for the Weary 237

The REST Philosophy 238

Choosing Your Data Exchange Format 238

A Hypothetical Web Service 241

Important Reminders  242

RESTfulEngine Architecture (iHotelApp Sample Code) 243

Summary 258

Further Reading 258

Chapter 15 Batten the Hatches with Security Services 261

Understanding the iOS Sandbox 261

Securing Network Communications 263

Employing File Protection 270

Using Keychains 272

Using Encryption 274

Summary 287

Further Reading 287

Chapter 16 Running on Multiple iPlatforms and iDevices 289

Developing for Multiple Platforms 290

Detecting Device Capabilities 294

In App Email and SMS 300

Checking Multitasking Awareness 300

Supporting the iPhone 5 301

UIRequiredDeviceCapabilities 303

Summary 304

Further Reading 304

Chapter 17 Internationalization and Localization 305

What Is Localization? 305

Localizing Strings 306

Auditing for Nonlocalized Strings 307

Formatting Numbers and Dates 309

Nib Files and Base Internationalization 312

Localizing Complex Strings 312

Summary 315

Further Reading 315

Chapter 18 Selling Past the Sale with In App Purchases 317

Before You Start 317

In App Purchase Products 317

Setting Up Products on iTunes Connect 320

In App Purchase Implementation 326

Introduction to MKStoreKit 327

Making the Purchase 331

Downloading Hosted Content 332

Testing Your Code  332

Troubleshooting 333

Summary 334

Further Reading 334

Chapter 19 Debugging 335

LLDB 335

Debugging with LLDB 335

Breakpoints 338

Watchpoints 343

The LLDB Console 344

NSZombieEnabled Flag 348

Different Types of Crashes 348

Collecting Crash Reports 352

Third-Party Crash Reporting Services 353

Summary 354

Further Reading 354

Chapter 20 Performance Tuning Until It Flies 357

The Performance Mindset 357

Welcome to Instruments 358

Finding Memory Problems 360

Finding CPU Problems 364

Drawing Performance 368

Optimizing Disk and Network Access 371

Summary 371

Further Reading 372

Part IV: Pushing the Limits 373

Chapter 21 Storyboards and Custom Transitions 375

Getting Started with Storyboards 375

Custom Transitions 380

Customizing Your Views Using UIAppearance Protocol 382

Summary  383

Further Reading 383

Chapter 22 Cocoa’s Biggest Trick: Key-Value Coding and Observing 385

Key-Value Coding  385

Key-Value Observing 395

KVO Tradeoffs 399

Summary  400

Further Reading 401

Chapter 23 Think Different: Blocks and Functional Programming 403

What Is a Block? 403

Declaring a Block 406

Implementing a Block 408

Blocks and Concurrency 410

Block-Based Cocoa Methods 412

Supported Platforms 415

Summary 415

Further Reading 415

Chapter 24 Going Offline  417

Reasons for Going Offline 417

Strategies for Caching 418

Data Model Cache 422

Cache Versioning 426

Creating an In-Memory Cache 427

Creating a URL Cache 431

Summary 433

Further Reading 433

Chapter 25 Data in the Cloud 435

iCloud 435

Third-Party Cloud Offerings 437

Parse  438

StackMob  442

Disadvantages of Using a Backend as a Service 444

Summary 444

Further Reading 444

Chapter 26 Fancy Text Layout 447

The Normal Stuff: Fields, Views, and Labels 447

Rich Text in UIKit 448

Web Views for Rich Text 453

Core Text 454

Summary  464

Further Reading 464

Chapter 27 Building a (Core) Foundation 465

Core Foundation Types 465

Naming and Memory Management 466

Allocators 467

Introspection 468

Strings and Data 469

Collections 474

Toll-Free Bridging 477

Summary 480

Further Reading 480

Chapter 28 Deep Objective-C 481

Understanding Classes and Objects 481

Working with Methods and Properties 483

How Message Passing Really Works 486

Method Swizzling  494

ISA Swizzling 496

Method Swizzling Versus ISA Swizzling 498

Summary 498

Further Reading 498

Index 501

See More

Author Information

ROB NAPIER has been developing iPhone applications for as long as there has been an iPhone platform. Before coming to Cocoa development, he made his living sneaking into Chinese facilities in broad daylight. He now is a Mac developer for Dell. It’s not clear which was the stranger choice of career. He has passion for the fiddly bits below the surface, like networking, performance, security, and correct use of the MVC pattern. He muses on technical topics at Cocoaphony (cocoaphony.net).

MUGUNTH KUMAR is an independent iOS developer based in Singapore. He holds a master’s degree from Nanyang Technological University. His core areas of interest include human-computer interaction and usability engineering. He writes in-depth articles covering iOS programming and the user experienced at blog.mugunthkumar.com

See More


Download TitleSizeDownload
iOS 6 PtL code

14.57 MB Click to Download
See More
Back to Top