Home > Store

Xcode 5 Start to Finish: iOS and OS X Development

Register your product to gain access to bonus material or receive a coupon.

Xcode 5 Start to Finish: iOS and OS X Development

eBook (Watermarked)

  • Your Price: $35.99
  • Includes EPUB and PDF
  • About eBook Formats
  • This eBook includes the following formats, accessible from your Account page after purchase:

    ePub EPUB The open industry format known for its reflowable content and usability on supported mobile devices.

    Adobe Reader PDF The popular standard, used most often with the free Adobe® Reader® software.

    This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

Not for Sale

Description

  • Copyright 2014
  • Dimensions: 7" x 9"
  • Edition: 1st
  • eBook (Watermarked)
  • ISBN-10: 0-13-375104-X
  • ISBN-13: 978-0-13-375104-8

Use Xcode 5 to Write Great iOS and OS X Apps!


Xcode 5 Start to Finish will help you use the tools in Apple’s Xcode 5 to improve productivity, write great code, and leverage the newest iOS 7 and OS X Mavericks features.


Drawing on thirty years of experience developing for Apple platforms and helping others do so, Fritz Anderson shows you a complete best-practice Xcode workflow. Through three full sample projects, you’ll learn to integrate testing, source control, and other key skills into a high-efficiency process that works.


Anderson shows you better ways to storyboard, instrument, build, and compile code, and helps you apply innovations ranging from Quick Look to Preview Assistant. By the time you’re finished, you’ll have the advanced Xcode skills to develop outstanding software.


Coverage includes

  • Setting breakpoints and tracing execution for active debugging
  • Creating libraries by adding and building new targets
  • Integrating Git or Subversion version control
  • Creating iOS projects with MVC design
  • Designing Core Data schemas for iOS apps
  • Linking data models to views
  • Designing UI views with Interface Builder
  • Using the improved Xcode 5 Autolayout editor
  • Improving reliability with unit testing
  • Simplifying iOS provisioning
  • Leveraging refactoring and continual error checking
  • Using OS X bindings, bundles, packages, frameworks, and property lists
  • Localizing your apps
  • Controlling how Xcode builds source code into executables
  • Analyzing processor and memory usage with Instruments
  • Integrating with Mavericks Server’s sleek continuous integration system

Register your book at www.informit.com/register for access to this title’s downloadable code.

Sample Content

Table of Contents

Acknowledgments xxiii
About the Author xxv

Introduction 1
How This Book Is Organized 1
About Versions 4
About the Code 4
Conventions 5

Part I: First Steps 7

Chapter 1: Getting Xcode 9

Before You Begin 9
Installing Xcode 10
Removing Xcode 11
Apple Developer Programs 12
Downloading Xcode 13
Additional Downloads 14
Summary 15

Chapter 2: Kicking the Tires 17
Starting Xcode 17
Hello World 18
Getting Rid of It 24
Summary 24

Chapter 3: Simple Workflow and Passive Debugging 25
Creating the Project 25
Building 29
Running 31
Simple Debugging 32
Summary 34

Chapter 4: Active Debugging 35
A Simple Test Case 35
Going Active 35
Fixing the Problem 39
Summary 43

Chapter 5: Compilation 45
Compiling 45
Linking 50
Dynamic Loading 52
Xcode and Clang 53
Compiler Products 58
Summary 62

Chapter 6: Adding a Library Target 63
Adding a Target 63
Target Membership 65
A Dependent Target 68
Summary 70

Chapter 7: Version Control 73
Taking Control 74
The State of Your Files 76
Your First Commit 78
Working with Remote Repositories 79
Merges and Conflicts 83
The Version Editor 93
Branching 96
Summary 98

Part II: The Life Cycle of an iOS Application 101

Chapter 8: Starting an iOS Application 103

Planning the App 103
Starting a New iOS Project 106
What’s in the Project 108
One More Thing 110
Summary 112

Chapter 9: An iOS Application: Model 113
Implementing the Model 113
Managed-Object Classes 120
Making the Model Easier to Debug 131
Summary 132

Chapter 10: An iOS Application: Controller 133
Renaming Symbols 133
Editing the View Controller 136
Live Issues and Fix-it 138
The Real Passer Rating 140
Summary 145

Chapter 11: Building a New View 147
The Next View Controller 147
Building a View 152
The Table View 161
Outlets 161
Testing the Billboard View 170
Summary 171

Chapter 12: Autolayout in a New View 173
Why Autolayout? 173
The Player Billboard, Revisited 175
The Label System 179
Summary 185

Chapter 13: Adding Table Cells 187
The Game Table 187
The Game Table: First Run 191
A Custom Table Cell 193
Adding Some Graphics 196
Summary 202

Chapter 14: Adding an Editor 205
The Plan 205
Adding a Modal Scene 205
The Editor View Controllers 210
Segues 218
Summary 219

Chapter 15: Unit Testing 221
The Test Navigator 222
Testing the CSV Reader 224
Testing and the Debugger 229
Application Tests 232
TestKit Assertions 233
Summary 236

Chapter 16: Measurement and Analysis 237
Speed 237
Memory 247
Summary 253

Chapter 17: Provisioning 255
Apple Developer Programs 255
Provisioning for iOS 257
The Capabilities Editor 262
OS X Sandboxing 264
Gatekeeper and Developer ID 266
Distribution Builds 269
Summary 273

Part III: Xcode for Mac OS X 275

Chapter 18: Starting an OS X Application 277

The Goal 277
Getting Started 278
Model 281
Wiring a Menu 287
Summary 293

Chapter 19: Bindings: Wiring an OS X Application 295
Laying Out the Document Window 295
Filling the Table— Bindings 301
Layering NSControllers 307
Running a Popover with Bindings 315
Running the Near-Final App 321
Summary 322

Chapter 20: A Custom View for OS X 323
A Graphing View 325
Back to the View Controller 328
QuickLook in the Debugger 332
Custom View Properties 334
Summary 336

Chapter 21: Localization 337
How Localization Works 337
Adding a Localization 338
Localizing MainMenu.xib 347
Localizing Info.plist 353
Strings in Code 355
Showing Mac Passer Rating in Finder 359
Summary 364

Chapter 22: Bundles and Packages 365
A Simple Package: RTFD 365
Bundles 367
Application Bundles 367
The Info.plist File 369
Info.plist Keys for Applications 371
Info.plist 379
Summary 379

Chapter 23: Frameworks 381
Adding a Framework Target 381
Installing a Framework 383
Building Mac Passer Rating 387
Debugging a Framework 388
Summary 394

Chapter 24: Property Lists 395
Property List Data Types 395
Editing Property Lists 396
Other Formats 406
Specialized Property Lists 407
Summary 408

Part IV: Xcode Tasks 409

Chapter 25: Documentation in Xcode 411

Quick Help 411
Open Quickly 413
Help 414
The Documentation Window 415
Keeping Current 419
Your Own Quick Help 421
Your Own Docsets 424
Summary 430

Chapter 26: The Xcode Build System 431
How Xcode Structures a Build 431
Build Variables 434
Settings Hierarchy 435
Editing Build Variables 437
Configurations 438
Configuration Files 439
Command-Line Tools 443
Custom Build Rules 446
The Build Log 448
A Simple Build Transcript 450
Summary 458

Chapter 27: Instruments 459
What Instruments Is 459
Running Instruments 460
The Instruments 474
Custom Instruments 480
The Templates 482
Summary 484

Chapter 28: Debugging 485
Scheme Options 485
Doing More with Breakpoints 488
The lldb Command Line 491
Tips 493
Summary 497

Chapter 29: Continuous Integration 499
Xcode Server 500
Bots 503
Seeing the Results 507
Building for Distribution 508
Summary 509

Chapter 30: Snippets 511
Tricks 511
Traps 522

Part V: Appendixes 525

Appendix A: Some Build Variables 527

Useful Build Variables 528
Environment 528
Code Signing 529
Locations 530
Compiler Settings 533
Search Paths 535
Info.plist 535
The DEVELOPER Variables 536
Source Trees 537

Appendix B: Resources 539
Books 539
On the Net 540
Face to Face 544
Other Software 544

Index 555

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020