Apress Pro iOS 5 Tools, Xcode Instruments and Build Tools (2011).pdf

(11371 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
iOS 5 SDK apps development using Xcode,
Interface Builder, Instruments, GDB, and key tools
Interface Builder, Instruments, GDB, and key tools
Interface Builder, Instruments, GDB, and key tools
Pro
Pro
iOS 5 Tools
Xcode, Instruments, and Build Tools
Brandon Alexander | J.Bradford Dillon | Kevin Y. Kim
866515546.042.png 866515546.051.png 866515546.061.png 866515546.072.png 866515546.001.png
 
 
 
 
 
 
 
 
866515546.012.png 866515546.013.png
 
866515546.014.png 866515546.015.png 866515546.016.png 866515546.017.png 866515546.018.png 866515546.019.png
 
 
 
 
 
 
 
866515546.020.png 866515546.021.png 866515546.022.png 866515546.023.png 866515546.024.png 866515546.025.png 866515546.026.png 866515546.027.png 866515546.028.png 866515546.029.png 866515546.030.png 866515546.031.png 866515546.032.png 866515546.033.png 866515546.034.png 866515546.035.png 866515546.036.png 866515546.037.png 866515546.038.png 866515546.039.png
 
 
866515546.040.png 866515546.041.png 866515546.043.png 866515546.044.png 866515546.045.png 866515546.046.png 866515546.047.png 866515546.048.png 866515546.049.png 866515546.050.png
 
 
866515546.052.png 866515546.053.png 866515546.054.png 866515546.055.png 866515546.056.png 866515546.057.png 866515546.058.png 866515546.059.png 866515546.060.png 866515546.062.png 866515546.063.png 866515546.064.png 866515546.065.png 866515546.066.png 866515546.067.png 866515546.068.png 866515546.069.png 866515546.070.png 866515546.071.png 866515546.073.png
 
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
866515546.074.png 866515546.075.png 866515546.076.png 866515546.077.png 866515546.078.png 866515546.079.png 866515546.080.png 866515546.081.png
Contents at a Glance
Contents .............................................................................................................. v
About the Authors.............................................................................................. ix
About the Technical Reviewer ............................................................................ x
Acknowledgments ............................................................................................. xi
Introduction ...................................................................................................... xii
Chapter 1: Wax On, Wax Off............................................................................. 1
Chapter 2: First-Class Tools ............................................................................ 7
Chapter 3: Three Screens . . . and Well, It Runs ............................................ 37
Chapter 4: Memory Management and Diagnostics ....................................... 49
Chapter 5: Core Animation and Smooth Scrolling ......................................... 99
Chapter 6: Networking, Cache, and Power Management............................ 137
Chapter 7: Prepare the Beta!....................................................................... 175
Chapter 8: Why Are Things Breaking?......................................................... 203
Chapter 9: Can We Automate Some of This? ............................................... 241
Chapter 10: Now, They Want an iPad Version ............................................. 275
Chapter 11: How Do I Share Some of This? ................................................. 309
Chapter 12: One More Thing ........................................................................ 349
Index ............................................................................................................... 369
iv
866515546.002.png 866515546.003.png 866515546.004.png 866515546.005.png 866515546.006.png 866515546.007.png
1
Chapter
Wax On, Wax Off
By now, you have written an iOS application or two. You have also learned that making
a great app is hard work. From spontaneous crashes to memory leaks and bugs that
create other bugs, the simplest of apps can quickly become a nightmare. Fortunately,
these issues are easy to diagnose with the tools at our disposal.
That is what this book is mostly about. We have a toolbox available to us as iOS
developers. Ultimately, the question quickly becomes: Which tool is best for the task at
hand? This book will answer that question for most of your cases. For the cases where
there is no obvious answer, you will be equipped with some approaches and techniques
that will point you in the right direction.
Who Is This Book For?
In most crafts, the transition from being a complete beginner to being capable is usually
swift. The goal during this transition is simply to become functional with the tools and
understand the language the craftsmen speak. This transition also builds confidence in
the new practitioner. At the end of this transition, practitioners are fully capable of
accomplishing most tasks and solving most problems thrown at them.
Most stop at proficient, however. As a magician, I progressed from a newcomer to the
art to a proficient amateur relatively quickly. As I learned a new technique or a new
effect, I was very excited to practice. As my skill improved, that desire to practice
lessened, and I even became bored with rehearsing the same effect or technique over
and over. My skill had reached a plateau. I know what I must do to get to the next level,
but I don’t want to go there right now. That is OK with me.
How is this relevant to software development? First, like any craft, a certain set of
programming skills is rapidly acquired, including learning the syntax of a language,
understanding flow control, using basic software design patterns, and debugging by
writing to standard out and basic use of the provided debugger. The next phase of a
developer’s path to mastery is learning more about how a language and platform work,
more design patterns and their appropriate uses, and more about the debugger. The
final, never-ending, phase is simply fine-tuning all of these skills and finding better
1
866515546.008.png 866515546.009.png 866515546.010.png
2
CHAPTER 1: Wax On, Wax Off
solutions to existing problems, as well as learning how to reuse code more. This learning
path is not the same for every developer. Sometimes, different parts of development are
easier to grasp than others.
The point here is that I don’t want you to get frustrated when you don’t progress as fast
as you’d like. Software development is hard. The thing that separates a hobbyist from a
professional is the level of commitment. The commitment to go from a proficient
hobbyist to a professional generally takes you into career mode. This level of dedication
takes more than just hours of practice. You have to start looking at how other software
is made. Surrounding yourself with others that develop for the same platform, especially
those who are better than you, is key to growing. By purchasing this book, you are also
acknowledging that you want to be a better developer. My goal is to help you learn at
least one new skill. If you do that, my job is done, and if you do more, even better!
So who is this book for? This book is for those who are ready to reach the next level.
Whatever skill level you are at, this book has something for you. Perhaps you are a
master at object-oriented programming, and performance tuning is something you want
to learn. Or maybe you want to know the best way to create a universal application for
iOS without rewriting half your application. The only prerequisite is that you have some
exposure to iOS development and Objective-C.
What This Book Is
This book is a guide that will take you from an alpha quality application to a feature-
complete and tested application ready for submission to the App Store. This book
contains many tricks of the trade, from diagnosing memory issues to tweaking scroll
views to squeeze the last bit of performance out of the device. In the end, you’ll want to
have this book on your desk with pages marked for quick reference on how to solve
common problems.
Will this book solve all of your problems? Probably not, but you will walk away with
some techniques for solving problems in a very systematic way. Deep down, we’re
scientists, and following the scientific method for solving problems in software will, in
the end, help us learn how to prevent the problem next time.
This book also follows a realistic software life cycle. We’ll pick up a project at the end of
development, and we’ll take it through beta testing and finish with a shippable product.
We’ll hit some common roadblocks and look at how iOS works; we’ll even work around
some interesting issues. We’ll also find some useful libraries written by people who
cared enough to share their solutions to particular problems.
What You Need to Get Started
To get the most out of this book, you’ll need a paid developer account in the iOS Dev
Center. This will give you the ability to test on an iOS device as well as run the
performance tools against the iOS device. We will do several things on the device itself,
and your best bet is to go ahead and sign up for the paid developer account if you don’t
866515546.011.png
Zgłoś jeśli naruszono regulamin