Tải bản đầy đủ (.pdf) (7 trang)

0470500972_split_1_4211

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.14 MB, 7 trang )

Lee

Get started developing iPhone apps
using the Apple iPhone SDK








Wei-Meng Lee is Founder of Developer Learning Solutions, a technology company
specializing in hands-on training of the latest Microsoft and Apple technologies.
He writes extensively for online publications and is the author of Professional
Windows Vista Gadgets Programming and C# 2008 Programmer’s Reference.
Wrox Beginning guides are crafted to make learning programming languages
and technologies easier than you think, providing a structured, tutorial format
that will guide you through all the techniques involved.

Programming / Mac & iPhone

$39.99 USA
$47.99 CAN

Programmer
Forums
Join our Programmer to
Programmer forums to ask
and answer programming
questions about this book,


join discussions on the
hottest topics in the industry,
and connect with fellow
programmers from around
the world.

Code Downloads
Take advantage of free code
samples from this book, as
well as code samples from
hundreds of other books, all
ready to use.

Read More
Find articles, ebooks, sample
chapters and tables of contents
for hundreds of books, and
more reference resources on
programming topics that matter
to you.

đ

ã
ã

Explains how the fundamental concepts of outlets and actions allow
your code to interact with the visual elements in Interface Builder
Describes the use of the various views that make up the user
interface (UI) of your iPhone apps

Shows you how to build Tab Bar, Navigation, and Utility applications
Explores the powerful Table view and how it can be used to display
rows of data
Discusses using application settings to persist application preferences
Demonstrates how to implement multi-touch capability in your
iPhone application
Introduces the various techniques you can apply to develop animations
for the iPhone

wrox.com

iPhone SDK

Beginning iPhone SDK:

Wrox Programmer to Programmer™

Beginning

Programming with Objective-C®

Learning to develop iPhone applications doesn’t need to be an
overwhelming undertaking. This book provides an easy-to-follow,
example-driven introduction to the fundamentals of the Apple
iPhone SDK and offers you a clear understanding of how
things are done when programming iPhone applications with
Objective-C. As you progress through the exercises featured in
each chapter, you will discover the simple logic behind each step
required for creating your own iPhone applications. When you
reach the end of the book, you will be prepared to confidently

tackle your next iPhone programming challenge.

Join the discussion @ p2p.wrox.com

Beginning

iPhone SDK
®

®

Programming with Objective-C
Wei-Meng Lee


Related Wrox Books
Beginning Mac OS X Snow Leopard Programming

Programmer to Programmer



Get more out of
wrox.com
Interact

Join the Community

Take an active role online by participating in our
P2P forums @ p2p.wrox.com


Sign up for our free monthly newsletter at
newsletter.wrox.com

Wrox Online Library

Browse

Hundreds of our books are available online
through Books24x7.com

Ready for more Wrox? We have books and
e-books available on .NET, SQL Server, Java,
XML, Visual Basic, C#/ C++, and much more!

Wrox Blox
Download short informational pieces and code
to keep you up to date and out of trouble!

Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing

ISBN: 9780470577523
This book serves as a solid guide to getting started with Mac OS X programming. You will learn how to use the free software development
tools that come with all Mac OS X systems and how to efficiently start writing programs on Mac OS X Snow Leopard. The author shows
you how to use all of the programming languages to use together in order to create seamless applications.

Professional Android Application Development
ISBN: 0470344717

Offering an open development environment, Android represents an exciting new opportunity to write innovative applications for mobile
devices. This book provides you with a hands-on guide to building these applications using the Android software development kit. It takes
you through a series of sample projects, each introducing new features and techniques to get the most out of Android. You’ll learn all
about the basic functionality as well as discover how to utilize the advanced features with the help of concise and useful examples. You’ll
get the grounding and knowledge that is needed to write customized mobile applications using the current Android 1.0 SDK. Plus, you’ll
also gain the flexibility to quickly adapt to future enhancements in order to build the most cutting-edge solutions.

Professional Xcode 3
ISBN: 9780470525227
The steady increase in sales of Apple computers has triggered a strong interest in gaining a thorough understanding of Xcode and its
tools and what they have to offer. This book provides you with an inside look at the array of Xcode tools from top to bottom. You’ll go
beyond the basics and dive into such in-depth topics as installing the latest version of Xcode tools, customizing the look and behavior of
Xcode, creating and managing projects, using the built-in class browser to model complex applications and structures, and more. With
this book, you’ll be able to take full advantage of the range of tools included with Xcode.

Safari and WebKit Development for iPhone OS 3.0
ISBN: 9780470549667
With the unparalleled success of iPhone and iPod touch, iPhone OS 3.0 has emerged as a compelling platform for which vast numbers of
web developers are designing and building web-based mobile applications. This book explores the Safari and WebKit development platform that
is built into iPhone OS 3.0 and takes you through the process of creating an iPhone web application from the ground up. You’ll learn how
to use existing open source frameworks to speed up your development time, imitate qualities of built-in Apple apps, cache data locally
and even run in offline mode, and more. Whether you’re eager to build new web applications for iPhone OS 3.0 or optimize existing web
sites for this platform, you have everything you need to do so within this book.


Simpo PDF Merge and Split Unregistered Version -

BEGINNING
IPHONE® SDK PROGRAMMING WITH OBJECTIVE-C®
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi


PART I

GETTING STARTED

CHAPTER 1

Getting Started with iPhone Programming . . . . . . . . . . . . . . . . . . . . . . . . . 3

CHAPTER 2

Write Your First Hello World! Application . . . . . . . . . . . . . . . . . . . . . . . . . 23

CHAPTER 3

Outlets, Actions, and View Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

CHAPTER 4

Exploring the Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

CHAPTER 5

Keyboard Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

CHAPTER 6

Screen Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

PART II


BUILDING DIFFERENT TYPES OF IPHONE APPLICATIONS

CHAPTER 7

View Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

CHAPTER 8

Tab Bar and Navigation Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

CHAPTER 9

Utility Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

PART III

DISPLAYING AND PERSISTING DATA

CHAPTER 10

Using the Table View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

CHAPTER 11

Application Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263

CHAPTER 12

Database Storage Using SQLite3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287


CHAPTER 13

File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

PART IV ADVANCED IPHONE PROGRAMMING TECHNIQUES

ffirs.indd I

CHAPTER 14

Programming Multi-touch Applications . . . . . . . . . . . . . . . . . . . . . . . . . . 317

CHAPTER 15

Simple Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

CHAPTER 16

Accessing Built-in Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

CHAPTER 17

Accessing the Hardware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379

12/1/09 6:57:09 AM


Simpo PDF Merge and Split Unregistered Version -


PART V

APPENDICES

APPENDIX A

Answers to Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405

APPENDIX B

Getting Around in Xcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

APPENDIX C

Getting Around in Interface Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

APPENDIX D

Crash Course in Objective-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455

APPENDIX E

Testing on an Actual iPhone or iPod Touch . . . . . . . . . . . . . . . . . . . . . . 483

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499

ffirs.indd II

12/1/09 6:57:10 AM



Simpo PDF Merge and Split Unregistered Version -

BEGINNING

iPhone® SDK Programming
with Objective-C®

ffirs.indd III

12/1/09 6:57:11 AM


Simpo PDF Merge and Split Unregistered Version -
Summary

❘ 315

EXERCISES

c13.indd 315

1.

Describe the uses of the various folders within an application’s folder.

2.

What is the difference between the NSDictionary and NSMutableDictionary classes?


3.

Name the paths of the Documents and tmp folders on a real device.

11/28/09 1:41:54 PM


Simpo PDF Merge and Split Unregistered Version -
316



CHAPTER 13

FILE HANDLING

WHAT YOU HAVE LEARNED IN THIS CHAPTER
TOPIC

KEY CONCEPTS

Subdirectories in each
of the applications
folder

Documents, Library, and tmp

Getting the path of the
Documents directory


NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex:0];

Getting the path of the
tmp directory

-(NSString *) tempPath {
return NSTemporaryDirectory();
}

Check whether file
exists

if ([[NSFileManager defaultManager]
fileExistsAtPath:filePath]) {
}

c13.indd 316

Location of the
Documents directory
on a real device

/private/var/mobile/Applications/<application_id>/
Documents/

Location of the tmp
directory on a real

device

/private/var/mobile/Applications/<application_id>/tmp/

Load a property list
from the Resources
folder

NSString *pListPath = [[NSBundle mainBundle]

Create a mutable copy
of an NSDictionary
object

NSDictionary *dict = [[NSDictionary alloc]

pathForResource:@"Apps"
ofType:@"plist"];

initWithContentsOfFile:pListPath];
NSMutableDictionary *copyOfDict = [dict mutableCopy];

11/28/09 1:41:54 PM



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×