Mark / Llopis / Bruzenak | iPhone Advanced Projects | E-Book | www.sack.de
E-Book

E-Book, Englisch, 392 Seiten

Mark / Llopis / Bruzenak iPhone Advanced Projects


1. ed
ISBN: 978-1-4302-2404-4
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

E-Book, Englisch, 392 Seiten

ISBN: 978-1-4302-2404-4
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



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.

Mark / Llopis / Bruzenak iPhone Advanced Projects jetzt bestellen!

Weitere Infos & Material


1;Dedication Page;4
2;Contents at a Glance;5
3;Table of Contents;6
4;Foreword;12
5;About the Technical Reviewer;13
6;Preface;14
6.1;Organization;15
6.2;What’s in the Book;15
7;CHAPTER 1: Everything You Ever Wanted to Know About Particle Systems;19
7.1;Adding Life to Your Game with Particles;21
7.2;Basic Particle Systems and You;23
7.2.1;Overview of the Sample Code;24
7.2.2;Basic Game Flow;25
7.2.3;The Anatomy of a Particle System;26
7.2.4;Code! Finally!;28
7.2.5;Slight Tangent About Degenerates;31
7.2.6;Back to the Code;32
7.2.7;Random Numbers and Initial Conditions;35
7.2.8;Emitting Particles;36
7.3;Tweaking Your Particle System;37
7.3.1;May the Force Be with Your Particles;41
7.4;Amazing Technicolor Dream Particle;44
7.4.1;Off on a Tangent: Lerping;44
7.4.2;Color-Changing Particles;46
7.5;Summary;51
8;Chapter 2: Chess on the ’Net: Correspondence Gaming with Deep Green;55
8.1;Deep Green, an Already Awesome Application;56
8.2;The Tasks at Hand;58
8.2.1;Inviting a Friend to a Game;59
8.2.2;Accepting the Invitation;59
8.2.3;Making a Move;59
8.2.4;Getting Notified;59
8.3;The Tools of the Trade;60
8.4;Stop Talking, Start Coding!;61
8.4.1;Installing the Tools;61
8.4.2;Coding the Web Service;63
8.4.3;Accepting the Challenge on the Device;70
8.4.3.1;Registering URL Scheme Support with iPhone OS;70
8.4.3.2;Handling the URL Request;70
8.4.3.3;Separating Data and Representation on the Server;72
8.4.4;Making a Move;73
8.4.4.1;On the Device;73
8.4.4.2;On the Server;75
8.5;Summary;77
9;Chapter 3: Audio Streaming: An Exploration into Core Audio;80
9.1;Hey, I Could Write an App to Play Music;81
9.2;MPMoviePlayerController: Hey, This Is Easy! Right?;81
9.3;Finding a Better Approach;83
9.3.1;The System-Sound Way;84
9.3.2;AVAudioPlayer: The Not-Available-in-Beta Way;84
9.3.2.1;DOWNLOADING DATA WITH NSURLCONNECTION;87
9.4;Doing It the Cowboy Way with Core Audio;89
9.4.1;Getting Halfway There: Audio Queue Services;89
9.4.1.1;A WORD ON PROGRAMMING LANGUAGES;90
9.4.1.2;BEWARE THE SIMULATOR;90
9.4.2;Getting the Rest of the Way There: Audio File Stream Services;96
9.4.2.1;BUFFERING ON MOBILE DEVICES;99
9.4.2.2;THE AUDIO SESSION;107
9.5;Putting It All into an App;108
9.5.1;One More Thing;108
9.6;Launch It;111
9.7;iPhone 3.0 and Further Work;111
9.8;Summary;112
10;Chapter 4: You Go Squish Now! Debugging on the iPhone;115
10.1;Assumed Knowledge;116
10.2;Objective-C vs. C and C++;118
10.3;While You’re Writing That Code;119
10.3.1;Custom Asserts;119
10.3.2;Custom Logging;121
10.3.3;Using #define;122
10.4;Crash!;123
10.4.1;Getting a Crash Log from Your Testers;123
10.4.2;You Have Been Saving Your dSYM Files, Right?;124
10.4.3;Symbolicating a Crash Log;124
10.4.4;Using atos;125
10.5;Reproducing Rare Crashes;126
10.5.1;Thread;126
10.5.2;System;127
10.5.3;Race Conditions;127
10.6;The Scientific Method of Debugging;127
10.6.1;Forming a Hypothesis;127
10.6.2;Creating a Test for Your Hypothesis;128
10.6.3;Proving or Disproving Your Hypothesis;129
10.6.4;Increasing the Probability of the Crash;129
10.7;So, You Have a Call Stack;129
10.7.1;Starting Code;129
10.7.2;What Is a Memory Stomp?;132
10.7.2.1;Buffer Overruns;133
10.7.2.2;Calling a Deleted Method;133
10.7.2.3;Returning to a Deleted Object;134
10.7.3;Identifying a Mem Stomp;136
10.7.4;Tools to Detect Memory Problems;137
10.7.4.1;malloc_error_break;137
10.7.4.2;NSZombieEnabled;140
10.7.4.3;Enable Guard Malloc;143
10.7.5;Watching Variables;145
10.7.6;Link Map Files;149
10.8;Summary;151
11;Chapter 5: Building Data-Driven Applications with Active Record and SQLite;154
11.1;A Short Road Off a High Cliff (How I Got Here);154
11.2;Ready! Set! Wait, What? (Why I Decided to Write a To-Do Application);155
11.3;Data-Driven Applications on the iPhone;156
11.4;Active Record: A Simple Way of Accessing Data;157
11.5;Writing a Database Wrapper Around the C API: ISDatabase;157
11.5.1;Setting Up the Example Project;158
11.5.2;Creating and Initializing the Database;161
11.5.3;Opening a Database Connection;162
11.5.4;Making Simple Requests;165
11.6;More Advanced SQL;171
11.6.1;Preventing Duplicate Create Statements;171
11.6.2;Handling Parameters;173
11.6.3;Refactoring and Cleanup;175
11.6.4;Grouping Statements into Transactions;176
11.7;Writing a Simple Active Record Layer: ISModel;177
11.7.1;Maintaining the Database Connection;178
11.7.2;The Model Object: Grocery Item;178
11.7.3;How Groceries Are Mapped;179
11.7.4;Saving;181
11.7.5;Updating;183
11.7.6;Deleting;183
11.7.7;Finding Grocery Items;184
11.7.8;Putting It All Together;187
11.7.9;Simple Migration Handling;189
11.7.10;Alternative Implementations;192
11.7.11;Summary;193
12;Chapter 6: Core Data and Hard-Core Design;196
12.1;Where Did Core Data Come From?;197
12.1.1;The Client Is King;197
12.2;A Very First Core Data App;198
12.2.1;First, Steal Code (Not Music!);199
12.2.2;A View to an Object, Any Object;200
12.2.3;Our Very First Crash, or Perhaps Not;206
12.3;CoreData Tutorial for iPhone OS: Managing Model Migrations;207
12.3.1;The Easy Migrations Are Easy;207
12.3.2;Adding a New Entity;210
12.4;Using Key-Value Coding to Create a Reusable Object;212
12.5;Remote Databases: It’s All Net;216
12.6;Summary;219
13;Chapter 7: mart In-Application E-mail with Core Data and Three20;223
13.1;Planning a Simple Offline SMTP Client;224
13.2;Creating the User Interface;225
13.2.1;Diving into Xcode;225
13.2.2;Setting Up Instance Variables in OfflineMailerAppDelegate.h;227
13.2.3;Initializing the UIApplication Delegate;229
13.3;Working with Core Data;230
13.3.1;Understanding the Core Data Stack;233
13.3.2;Adding Three20;233
13.4;Journeying Through the User Interface;236
13.5;Managing Top-Level Data with DataManager;238
13.6;Diving into Three20 and TTMessageController;240
13.7;Composing and Sending Messages;242
13.8;Creating the Core Data Model;247
13.9;Hacking SKPSMTPMessage to Support Threaded Message Sending;251
13.10;Setting Up the NSRunLoop on SKPSMTPMessage;251
13.11;Switching the Bits Back to Online Mode;253
13.12;Summary;256
14;Chapter 8: How iTap Tackles the Challenges of Networking;260
14.1;Meet iTap and iTap Receiver;261
14.1.1;iTap;262
14.1.2;iTap Receiver;262
14.2;How the Idea for iTap Emerged and Evolved;263
14.3;The Main Challenges;263
14.3.1;No Physical Buttons on the iPhone;263
14.3.2;Third-Party Applications Cannot Use USB or Bluetooth;264
14.3.3;Supporting Both Mac and PC;265
14.3.4;User-Friendliness Demands Autodiscovery of Computers and Devices;266
14.4;WiFi Networking on the iPhone from a Programmer’s Perspective;266
14.4.1;About the Sample Code;267
14.4.2;Introducing Sockets;268
14.4.2.1;Address Family;268
14.4.2.2;Socket Type;268
14.4.2.3;Protocol;269
14.4.3;Creating a Socket;269
14.4.3.1;Local and Remote Addresses;269
14.4.3.2;BYTE ORDERING;270
14.4.3.3;Setting a Socket’s Local and Remote Address;271
14.4.3.4;Sending and Receiving Data;271
14.4.3.5;Raw BSD Sockets vs. User Experience;272
14.4.4;Using CFSocket to React to Networking Events;273
14.4.4.1;Reacting to Incoming Datagrams;273
14.4.5;Querying the Network Configuration;275
14.4.5.1;Introducing IO Controls;275
14.4.5.2;Querying the Names of the Available Interfaces Using the SIOCGIFCONF IO Control;275
14.4.5.3;Querying an Interface’s Flags Using the SIOCGIFFLAGS IO Control;277
14.4.5.4;Other Interesting IO Controls;278
14.4.6;Contacting All Devices on the Network;278
14.4.7;Detecting WiFi Availability;279
14.4.8;Playing by the Power Management Rules;280
14.4.8.1;Informing iPhone OS About Your Application’s Networking Requirements;280
14.4.8.2;Minimizing Power Consumption While the iPhone Is Locked;281
14.5;The Networking Subsystem of iTap;282
14.5.1;To use Bonjour or Not to Use Bonjour;282
14.5.2;Using Notifications to Communicate Between Components;283
14.5.3;Our Custom Autodiscovery Solution;284
14.6;Summary;286
15;Chapter 9: Fake It ’Til You Make It: Tips and Tricks for Improving Interface Responsiveness;289
15.1;Plotting of Historical Stock Prices with AAPLot;290
15.1.1;Storing Data Between Runs;293
15.1.1.1;WRITING TO THE IPHONE’S NAND FLASH MEMORY;294
15.1.2;Using Plists to Persist Data;294
15.1.3;Saving Data to the iPhone Application Sandbox;295
15.2;Shipping AAPLot with Placeholder Data;296
15.3;Extending the App for Multiple Stock Graphs: StockPlot;298
15.4;Concurrency;302
15.4.1;NSOperation, NSOperationQueue, and Blocks;303
15.4.2;Installing the Plausible Blocks Compiler and Adding It to the Project;304
15.4.3;Using Blocks, NSOperation, and NSOperationQueue in StockPlot;305
15.5;Displaying Large Amounts of Data Efficiently;308
15.6;Zooming a UIScrollView;310
15.6.1;UIScrollView Zooming Under the Covers;310
15.6.2;Resetting Resolution in a UIScrollView after a Zoom Operation;311
15.7;Drawing into an Off-Screen Context;314
15.8;Observations, Tips, and Tricks;319
15.9;Summary;320
16;Chapter 10: Demystifying the Apple Push Notification Service;323
16.1;What Is the Apple Push Notification Service?;324
16.2;What You’ll Need;324
16.3;Step 1: Create the Client;324
16.3.1;The Application Delegate;325
16.3.1.1;Registration;325
16.3.1.2;Device Token Acquisition;326
16.3.1.3;Check for Errors;327
16.3.2;Handling Incoming Notifications;327
16.3.3;Sounds;328
16.3.4;Build and Go! Er, Not So Fast...;328
16.4;Step 2: Create the Certificate;329
16.4.1;A Walk-Through of the Program Portal Process;329
16.4.2;Back to the Portal;338
16.4.3;Add the Mobile Provisioning File for Code Signing;339
16.5;Step 3: Set Up the Server;341
16.5.1;A Walk-Through of What This Script Does;343
16.5.2;Download Server File;344
16.6;The Home Stretch;346
16.6.1;Wiring Up the Client;346
16.7;Additional Considerations/Advanced Topics;351
16.7.1;Feedback Server;351
16.7.2;SSL Server Connections;352
16.7.3;Moving from Development Sandbox to Production;352
16.7.4;Development vs. Ad Hoc;353
16.7.5;Mobile Provisioning Files;353
16.7.6;Debugging;353
16.7.7;User Experience;353
16.7.8;Open Source Code;354
16.7.9;Hosted Solutions;354
16.8;Summary;354
17;Chapter 11: Environment Mapping and Reflections with OpenGL ES;357
17.1;The Beginnings;357
17.2;First Steps: OpenGL Lighting;359
17.3;Turning to Environment Mapping;362
17.4;Spherical Environment Mapping Implementation;363
17.5;Combining Environment Mapping and Diffuse Textures;366
17.5.1;Per-Pixel Reflections;369
17.5.2;iPhone 3GS;372
17.6;Summary;373
18;Index;375



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.