iPhone Advanced Projects - David Mark, Dylan Bruzenak, Joachim Bondo, Owen Goss, Peter Honeder, Ray Kiddy, Steve Finkelstein, Tom Harrington, Jonathan Saggau, Noel Llopis, Ben Smith, Joe Pezzillo, Florian Pflug, Roderick Smith

iPhone Advanced Projects (eBook)

eBook Download: PDF
2010 | 1st ed.
392 Seiten
Apress (Verlag)
978-1-4302-2404-4 (ISBN)
Systemvoraussetzungen
34,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

As the fourth book in our series of iPhone Projects based on the work and experiences of iPhone, this volume takes on the more advanced aspects of iPhone development. The first generation of iPhone applications has hit the App Store, and now it's time to optimize performance, streamline the user interface, and make every successful iPhone app just that much more sophisticated.

Paired with Apress's bestselling Beginning iPhone Development: Exploring the iPhone SDK, you'll have everything you need to create the next great iPhone app that everyone is talking about.

  • Optimize performance.
  • Streamline your user interface.
  • Do things with your iPhone app that other developers haven't attempted.

Along with series editor Dave Mark, your guides for this exploration of the next level of iPhone development, include:

  • Ben 'Panda' Smith, discussing particle systems using OpenGL ES
  • Joachim Bondo, demonstrating his implementation of correspondence gaming in the most recent version of his chess application, Deep Green.
  • Tom Harrington implementing streaming audio with Core Audio, one of many iPhone OS 3 APIs.
  • Owen Goss debugging those pesky errors in your iPhone code with an eye toward achieving professional-strength results.
  • Dylan Bruzenak building a data-driven application with SQLite.
  • Ray Kiddy illustrating the full application development life cycle with Core Data.
  • Steve Finkelstein marrying an offline e-mail client to Core Data.
  • Peter Honeder and Florian Pflug tackling the challenges of networked applications in WiFi environments.
  • Jonathan Saggau improving interface responsiveness with some of his personal tips and tricks, including 'blocks' and other esoteric techniques.
  • Joe Pezzillo pushing the frontiers of APNS, the new in iPhone OS 3 Apple Push Notification Service that makes the cloud the limit for iPhone apps.
  • Noel Llopis taking mere programmers into a really advanced developmental adventure into the world of environment mapping with OpenGL ES.


Dave Mark is a longtime Mac developer and author who has written a number of books on Mac and iOS development, including Beginning iPhone 4 Development (Apress, 2010), More iPhone 3 Development (Apress, 2010), Learn C on the Mac (Apress, 2008), The Macintosh Programming Primer series (Addison-Wesley, 1992), and Ultimate Mac Programming (Wiley, 1995). Dave loves the water and spends as much time as possible on it, in it, or near it. He lives with his wife and three children in Virginia.
As the fourth book in our series of iPhone Projects based on the work and experiences of iPhone, this volume takes on the more advanced aspects of iPhone development. The first generation of iPhone applications has hit the App Store, and now it's time to optimize performance, streamline the user interface, and make every successful iPhone app just that much more sophisticated.Paired with Apress's bestselling Beginning iPhone Development: Exploring the iPhone SDK, you'll have everything you need to create the next great iPhone app that everyone is talking about. Optimize performance. Streamline your user interface. Do things with your iPhone app that other developers haven't attempted. Along with series editor Dave Mark, your guides for this exploration of the next level of iPhone development, include: Ben Panda Smith, discussing particle systems using OpenGL ES Joachim Bondo, demonstrating his implementation of correspondence gaming in the most recent version of his chess application, Deep Green. Tom Harrington implementing streaming audio with Core Audio, one of many iPhone OS 3 APIs. Owen Goss debugging those pesky errors in your iPhone code with an eye toward achieving professional-strength results. Dylan Bruzenak building a data-driven application with SQLite. Ray Kiddy illustrating the full application development life cycle with Core Data. Steve Finkelstein marrying an offline e-mail client to Core Data. Peter Honeder and Florian Pflug tackling the challenges of networked applications in WiFi environments. Jonathan Saggau improving interface responsiveness with some of his personal tips and tricks, including blocks and other esoteric techniques. Joe Pezzillo pushing thefrontiers of APNS, the new in iPhone OS 3 Apple Push Notification Service that makes the cloud the limit for iPhone apps. Noel Llopis taking mere programmers into a really advanced developmental adventure into the world of environment mapping with OpenGL ES.

Dave Mark is a longtime Mac developer and author who has written a number of books on Mac and iOS development, including Beginning iPhone 4 Development (Apress, 2010), More iPhone 3 Development (Apress, 2010), Learn C on the Mac (Apress, 2008), The Macintosh Programming Primer series (Addison-Wesley, 1992), and Ultimate Mac Programming (Wiley, 1995). Dave loves the water and spends as much time as possible on it, in it, or near it. He lives with his wife and three children in Virginia.

Dedication Page 4
Contents at a Glance 5
Table of Contents 6
Foreword 12
About the Technical Reviewer 13
Preface 14
Organization 15
What’s in the Book 15
CHAPTER 1: Everything You Ever Wanted to Know About Particle Systems 19
Adding Life to Your Game with Particles 21
Basic Particle Systems and You 23
Overview of the Sample Code 24
Basic Game Flow 25
The Anatomy of a Particle System 26
Code! Finally! 28
Slight Tangent About Degenerates 31
Back to the Code 32
Random Numbers and Initial Conditions 35
Emitting Particles 36
Tweaking Your Particle System 37
May the Force Be with Your Particles 41
Amazing Technicolor Dream Particle 44
Off on a Tangent: Lerping 44
Color-Changing Particles 46
Summary 51
Chapter 2: Chess on the ’Net: Correspondence Gaming with Deep Green 55
Deep Green, an Already Awesome Application 56
The Tasks at Hand 58
Inviting a Friend to a Game 59
Accepting the Invitation 59
Making a Move 59
Getting Notified 59
The Tools of the Trade 60
Stop Talking, Start Coding! 61
Installing the Tools 61
Coding the Web Service 63
Accepting the Challenge on the Device 70
Registering URL Scheme Support with iPhone OS 70
Handling the URL Request 70
Separating Data and Representation on the Server 72
Making a Move 73
On the Device 73
On the Server 75
Summary 77
Chapter 3: Audio Streaming: An Exploration into Core Audio 80
Hey, I Could Write an App to Play Music 81
MPMoviePlayerController: Hey, This Is Easy! Right? 81
Finding a Better Approach 83
The System-Sound Way 84
AVAudioPlayer: The Not-Available-in-Beta Way 84
DOWNLOADING DATA WITH NSURLCONNECTION 87
Doing It the Cowboy Way with Core Audio 89
Getting Halfway There: Audio Queue Services 89
A WORD ON PROGRAMMING LANGUAGES 90
BEWARE THE SIMULATOR 90
Getting the Rest of the Way There: Audio File Stream Services 96
BUFFERING ON MOBILE DEVICES 99
THE AUDIO SESSION 107
Putting It All into an App 108
One More Thing 108
Launch It 111
iPhone 3.0 and Further Work 111
Summary 112
Chapter 4: You Go Squish Now! Debugging on the iPhone 115
Assumed Knowledge 116
Objective-C vs. C and C++ 118
While You’re Writing That Code 119
Custom Asserts 119
Custom Logging 121
Using #define 122
Crash! 123
Getting a Crash Log from Your Testers 123
You Have Been Saving Your dSYM Files, Right? 124
Symbolicating a Crash Log 124
Using atos 125
Reproducing Rare Crashes 126
Thread 126
System 127
Race Conditions 127
The Scientific Method of Debugging 127
Forming a Hypothesis 127
Creating a Test for Your Hypothesis 128
Proving or Disproving Your Hypothesis 129
Increasing the Probability of the Crash 129
So, You Have a Call Stack 129
Starting Code 129
What Is a Memory Stomp? 132
Buffer Overruns 133
Calling a Deleted Method 133
Returning to a Deleted Object 134
Identifying a Mem Stomp 136
Tools to Detect Memory Problems 137
malloc_error_break 137
NSZombieEnabled 140
Enable Guard Malloc 143
Watching Variables 145
Link Map Files 149
Summary 151
Chapter 5: Building Data-Driven Applications with Active Record and SQLite 154
A Short Road Off a High Cliff (How I Got Here) 154
Ready! Set! Wait, What? (Why I Decided to Write a To-Do Application) 155
Data-Driven Applications on the iPhone 156
Active Record: A Simple Way of Accessing Data 157
Writing a Database Wrapper Around the C API: ISDatabase 157
Setting Up the Example Project 158
Creating and Initializing the Database 161
Opening a Database Connection 162
Making Simple Requests 165
More Advanced SQL 171
Preventing Duplicate Create Statements 171
Handling Parameters 173
Refactoring and Cleanup 175
Grouping Statements into Transactions 176
Writing a Simple Active Record Layer: ISModel 177
Maintaining the Database Connection 178
The Model Object: Grocery Item 178
How Groceries Are Mapped 179
Saving 181
Updating 183
Deleting 183
Finding Grocery Items 184
Putting It All Together 187
Simple Migration Handling 189
Alternative Implementations 192
Summary 193
Chapter 6: Core Data and Hard-Core Design 196
Where Did Core Data Come From? 197
The Client Is King 197
A Very First Core Data App 198
First, Steal Code (Not Music!) 199
A View to an Object, Any Object 200
Our Very First Crash, or Perhaps Not 206
CoreData Tutorial for iPhone OS: Managing Model Migrations 207
The Easy Migrations Are Easy 207
Adding a New Entity 210
Using Key-Value Coding to Create a Reusable Object 212
Remote Databases: It’s All Net 216
Summary 219
Chapter 7: mart In-Application E-mail with Core Data and Three20 223
Planning a Simple Offline SMTP Client 224
Creating the User Interface 225
Diving into Xcode 225
Setting Up Instance Variables in OfflineMailerAppDelegate.h 227
Initializing the UIApplication Delegate 229
Working with Core Data 230
Understanding the Core Data Stack 233
Adding Three20 233
Journeying Through the User Interface 236
Managing Top-Level Data with DataManager 238
Diving into Three20 and TTMessageController 240
Composing and Sending Messages 242
Creating the Core Data Model 247
Hacking SKPSMTPMessage to Support Threaded Message Sending 251
Setting Up the NSRunLoop on SKPSMTPMessage 251
Switching the Bits Back to Online Mode 253
Summary 256
Chapter 8: How iTap Tackles the Challenges of Networking 260
Meet iTap and iTap Receiver 261
iTap 262
iTap Receiver 262
How the Idea for iTap Emerged and Evolved 263
The Main Challenges 263
No Physical Buttons on the iPhone 263
Third-Party Applications Cannot Use USB or Bluetooth 264
Supporting Both Mac and PC 265
User-Friendliness Demands Autodiscovery of Computers and Devices 266
WiFi Networking on the iPhone from a Programmer’s Perspective 266
About the Sample Code 267
Introducing Sockets 268
Address Family 268
Socket Type 268
Protocol 269
Creating a Socket 269
Local and Remote Addresses 269
BYTE ORDERING 270
Setting a Socket’s Local and Remote Address 271
Sending and Receiving Data 271
Raw BSD Sockets vs. User Experience 272
Using CFSocket to React to Networking Events 273
Reacting to Incoming Datagrams 273
Querying the Network Configuration 275
Introducing IO Controls 275
Querying the Names of the Available Interfaces Using the SIOCGIFCONF IO Control 275
Querying an Interface’s Flags Using the SIOCGIFFLAGS IO Control 277
Other Interesting IO Controls 278
Contacting All Devices on the Network 278
Detecting WiFi Availability 279
Playing by the Power Management Rules 280
Informing iPhone OS About Your Application’s Networking Requirements 280
Minimizing Power Consumption While the iPhone Is Locked 281
The Networking Subsystem of iTap 282
To use Bonjour or Not to Use Bonjour 282
Using Notifications to Communicate Between Components 283
Our Custom Autodiscovery Solution 284
Summary 286
Chapter 9: Fake It ’Til You Make It: Tips and Tricks for Improving Interface Responsiveness 289
Plotting of Historical Stock Prices with AAPLot 290
Storing Data Between Runs 293
WRITING TO THE IPHONE’S NAND FLASH MEMORY 294
Using Plists to Persist Data 294
Saving Data to the iPhone Application Sandbox 295
Shipping AAPLot with Placeholder Data 296
Extending the App for Multiple Stock Graphs: StockPlot 298
Concurrency 302
NSOperation, NSOperationQueue, and Blocks 303
Installing the Plausible Blocks Compiler and Adding It to the Project 304
Using Blocks, NSOperation, and NSOperationQueue in StockPlot 305
Displaying Large Amounts of Data Efficiently 308
Zooming a UIScrollView 310
UIScrollView Zooming Under the Covers 310
Resetting Resolution in a UIScrollView after a Zoom Operation 311
Drawing into an Off-Screen Context 314
Observations, Tips, and Tricks 319
Summary 320
Chapter 10: Demystifying the Apple Push Notification Service 323
What Is the Apple Push Notification Service? 324
What You’ll Need 324
Step 1: Create the Client 324
The Application Delegate 325
Registration 325
Device Token Acquisition 326
Check for Errors 327
Handling Incoming Notifications 327
Sounds 328
Build and Go! Er, Not So Fast... 328
Step 2: Create the Certificate 329
A Walk-Through of the Program Portal Process 329
Back to the Portal 338
Add the Mobile Provisioning File for Code Signing 339
Step 3: Set Up the Server 341
A Walk-Through of What This Script Does 343
Download Server File 344
The Home Stretch 346
Wiring Up the Client 346
Additional Considerations/Advanced Topics 351
Feedback Server 351
SSL Server Connections 352
Moving from Development Sandbox to Production 352
Development vs. Ad Hoc 353
Mobile Provisioning Files 353
Debugging 353
User Experience 353
Open Source Code 354
Hosted Solutions 354
Summary 354
Chapter 11: Environment Mapping and Reflections with OpenGL ES 357
The Beginnings 357
First Steps: OpenGL Lighting 359
Turning to Environment Mapping 362
Spherical Environment Mapping Implementation 363
Combining Environment Mapping and Diffuse Textures 366
Per-Pixel Reflections 369
iPhone 3GS 372
Summary 373
Index 375

Erscheint lt. Verlag 29.4.2010
Zusatzinfo 392 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Betriebssysteme / Server iOS
Informatik Betriebssysteme / Server Macintosh / Mac OS X
Informatik Programmiersprachen / -werkzeuge Mac / Cocoa Programmierung
Mathematik / Informatik Informatik Theorie / Studium
Informatik Weitere Themen Smartphones / Tablets
Schlagworte Audio • Debugging • iPhone • Performance • SQL • Time
ISBN-10 1-4302-2404-5 / 1430224045
ISBN-13 978-1-4302-2404-4 / 9781430224044
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 4,6 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Unlock the world of iOS development with Swift 5.9, Xcode 15, and iOS …

von Ahmad Sahar

eBook Download (2023)
Packt Publishing (Verlag)
32,39
Für Einsteiger ohne Vorkenntnisse

von Daniela Eichlseder; Anja Schmid

eBook Download (2023)
BILDNER Verlag
9,99