没有合适的资源?快使用搜索试试~ 我知道了~
iOS Programming_ The Big Nerd Ranch Guide, 3_e pdf版本
4星 · 超过85%的资源 需积分: 9 187 下载量 149 浏览量
2012-06-23
11:03:56
上传
评论 8
收藏 37.15MB PDF 举报
温馨提示
试读
358页
PDF版本,iOS Programming_ The Big Nerd Ranch Guide, 3_e - Hillegass, Aaron,作者几十年的编程经验,十几年的教学经验,风格很适合中国人阅读,学习ios最好的书籍。
资源推荐
资源详情
资源评论
iOS Programming: The Big Nerd Ranch Guide
Joe Conway and Aaron Hillegass
Copyright © 2012 Big Nerd Ranch, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and
permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or
transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For
information regarding permissions, contact
Big Nerd Ranch, Inc.
154 Krog Street
Suite 100
Atlanta, GA 30307
(404) 478-9005
http://www.bignerdranch.com/
book-comments@bignerdranch.com
The 10-gallon hat with propeller logo is a trademark of Big Nerd Ranch, Inc.
Exclusive worldwide distribution of the English edition of this book by
Pearson Technology Group
800 East 96th Street
Indianapolis, IN 46240 USA
http://www.informit.com
The authors and publisher have taken care in writing and printing this book but make no expressed or implied
warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or
consequential damages in connection with or arising out of the use of the information or programs contained herein.
App Store, Apple, Cocoa, Cocoa Touch, Finder, Instruments, iCloud, iPad, iPhone, iPod, iPod touch, iTunes,
Keychain, Mac, Mac OS, Multi-Touch, Objective-C, OS X, Quartz, Retina, Safari, and Xcode are trademarks of
Apple, Inc., registered in the U.S. and other countries.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations
have been printed with initial capital letters or in all capitals.
Print ISBN-10 0321821521
Print ISBN-13 978-0321821522
Third edition, first printing, March 2012
Release K.3.1.1
Acknowledgments
While our names appear on the cover, many people helped make this book a reality. We would like to take this
chance to thank them.
The other instructors who teach the iOS Bootcamp fed us with a never-ending stream of suggestions and
corrections. They are Scott Ritchie, Brian Hardy, Mikey Ward, Christian Keur, Alex Silverman, Owen
Matthews, Brian Turner, Juan Pablo Claude, and Bolot Kerimbaev.
Our tireless editor, Susan Loper, took our distracted mumblings and made them into readable prose.
Our technical reviewers, Bill Monk and Jawwad Ahmad, helped us find and fix flaws.
Ellie Volckhausen designed the cover. (The photo is of the bottom bracket of a bicycle frame.)
Chris Loper at IntelligentEnglish.com designed and produced the print book and the EPUB and Kindle
versions.
versions.
The amazing team at Pearson Technology Group patiently guided us through the business end of book
publishing.
The final and most important thanks goes to our students whose questions inspired us to write this book and whose
frustrations inspired us to make it clear and comprehensible.
Table of Contents
Introduction
Prerequisites
What’s Changed in the Third Edition?
Our Teaching Philosophy
How To Use This Book
Using an eBook
How This Book Is Organized
Style Choices
Typographical Conventions
Necessary Hardware and Software
1. A Simple iOS Application
Creating an Xcode Project
Building Interfaces
Model-View-Controller
Declarations
Declaring instance variables
Declaring methods
Making Connections
Setting pointers
Setting targets and actions
Summary of connections
Implementing Methods
Build and Run on the Simulator
Deploying an Application
Application Icons
Launch Images
2. Objective-C
Objects
Using Instances
Creating objects
Sending messages
Destroying objects
Beginning RandomPossessions
Creating strings
Format strings
NSArray and NSMutableArray
Subclassing an Objective-C Class
Creating an NSObject subclass
Instance variables
Accessor methods
Instance methods
Initializers
Other initializers and the initializer chain
Using Initializers
Class methods
Testing your subclass
Exceptions and Unrecognized Selectors
Fast Enumeration
Challenges
Bronze Challenge: Bug Finding
Silver Challenge: Another initializer
Gold Challenge: Another Class
Are You More Curious?
For the More Curious: Class Names
3. Managing Memory with ARC
The Heap
The Stack
Pointer Variables and Object Ownership
Memory Management
Using ARC for memory management
How objects lose owners
How objects lose owners
Strong and Weak References
Properties
Declaring properties
Synthesizing properties
Instance variables and properties
Copying
Dot Syntax
For the More Curious: Autorelease Pool and ARC History
4. Delegation and Core Location
Projects, Targets, and Frameworks
Core Location
Receiving updates from CLLocationManager
Delegation
Protocols
Delegation, controllers, and memory management
Using the Debugger
Using breakpoints
Diagnosing crashes and exceptions
Bronze Challenge: Distance Filter
Silver Challenge: Heading
For the More Curious: Build Phases, Compiler Errors, and Linker Errors
Preprocessing
Compiling
Linking
5. MapKit and Text Input
Object Diagrams
MapKit Framework
Interface Properties
Being a MapView Delegate
Using the documentation
Your own MKAnnotation
Tagging locations
Putting the pieces together
Bronze Challenge: Map Type
Silver Challenge: Changing the Map Type
Gold Challenge: Annotation Extras
6. Subclassing UIView and UIScrollView
Views and the View Hierarchy
Creating a Custom View
The drawRect: Method
Core Graphics
UIKit Drawing Additions
Redrawing Views
Motion Events
Using UIScrollView
Panning and paging
Zooming
Hiding the Status Bar
Bronze Challenge: Colors
Silver Challenge: Shapes
Gold Challenge: Another View and Curves
7. View Controllers
UIViewController
Creating HypnoTime
Subclassing UIViewController
Another UIViewController
UITabBarController
View Controller Lifecycle
Initializing view controllers
UIViewController and lazy loading
View Controller Subclasses and Templates
Bronze Challenge: Another Tab
Silver Challenge: Controller Logic
For the More Curious: The main Function and UIApplication
For the More Curious: Retina Display
8. Notification and Rotation
Notification Center
UIDevice Notifications
Autorotation
Setting autoresizing masks programmatically and bitwise operations
Forcing Landscape Mode
Bronze Challenge: Proximity Notifications
Silver Challenge: Programmatically Setting Autoresizing Masks
Silver Challenge: Programmatically Setting Autoresizing Masks
Gold Challenge: Overriding Autorotation
For the More Curious: Overriding Autorotation
9. UITableView and UITableViewController
Beginning the Homepwner Application
UITableViewController
Subclassing UITableViewController
UITableView’s Data Source
Creating BNRItemStore
Implementing data source methods
UITableViewCells
Creating and retrieving UITableViewCells
Reusing UITableViewCells
Code Snippet Library
Bronze Challenge: Sections
Silver Challenge: Constant Rows
Gold Challenge: Customizing the Table
10. Editing UITableView
Editing Mode
Adding Rows
Deleting Rows
Moving Rows
Bronze Challenge: Renaming the Delete Button
Silver Challenge: Preventing Reordering
Gold Challenge: Really Preventing Reordering
11. UINavigationController
UINavigationController
An Additional UIViewController
Navigating with UINavigationController
Pushing view controllers
Passing data between view controllers
Appearing and disappearing views
UINavigationBar
Bronze Challenge: Displaying a Number Pad
Silver Challenge: Dismissing a Number Pad
Gold Challenge: Pushing More View Controllers
12. Camera
Displaying Images and UIImageView
Taking pictures and UIImagePickerController
Creating BNRImageStore
NSDictionary
Creating and using keys
Core Foundation and toll-free bridging
Wrapping up BNRImageStore
Dismissing the keyboard
Bronze Challenge: Editing an Image
Silver Challenge: Removing an Image
Gold Challenge: Camera Overlay
For the More Curious: Recording Video
13. UIPopoverController and Modal View Controllers
Universalizing Homepwner
Determining device family
UIPopoverController
More Modal View Controllers
Dismissing modal view controllers
Modal view controller styles
Completion blocks
Modal view controller transitions
Bronze Challenge: Universalizing Whereami
Silver Challenge: Peeling Aways the Layers
Gold Challenge: Popover Appearance
For the More Curious: View Controller Relationships
Parent-child relationships
Presenting-presenter relationships
Inter-family relationships
14. Saving, Loading, and Application States
Archiving
Application Sandbox
Constructing a file path
NSKeyedArchiver and NSKeyedUnarchiver
Application States and Transitions
Writing to the Filesystem with NSData
More on Low-Memory Warnings
剩余357页未读,继续阅读
mmmmmail
- 粉丝: 0
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页