Learning ios Programming



Similar documents
Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

2. About iphone ios 5 Development Essentials. 5. Joining the Apple ios Developer Program

Objective C and iphone App

Beginner level: Modules 1 to 18. Advanced level: Quick review of modules 1 to 18, then following to module A Simple ios Application

MA-WA1920: Enterprise iphone and ipad Programming

Mobile App Design and Development

ios SDK possibilities & limitations

Developing Applications for ios

Kevin Hoffman. Sams Teach Yourself. Mac OS* X Lion" App Development. 800 East 96th Street, Indianapolis, Indiana, USA

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Developing and deploying mobile apps

geniusport mobility training experts

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Enterprise Mobile App Management Essentials. Presented by Ryan Hope and John Nielsen

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011

IOS App Development Training

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

App Programming Guide for ios

How To Develop An App For Ios (Windows)

Building Apps for iphone and ipad. Presented by Ryan Hope, Sumeet Singh

The story so far: Teaching Mobile App Development at PG level at Londonmet

Mobile Phones Operating Systems

ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011

Mobile App Framework For any Website

iphone ios 6 Development Essentials

Developing Cross-platform Mobile and Web Apps

research: technical implemenation

The Bootstrapper's Guide to the Mobile Web by Deltina Hay. Mobile App Strategy Worksheet. I. Target Market, App Category, Platforms

ITG Software Engineering

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

View Controller Programming Guide for ios

The 8 th International Scientific Conference elearning and software for Education Bucharest, April 26-27, / X

Lecture 4 Cross-Platform Development. <lecturer, date>

Wiley Publishing, Inc.

Deploying Management and Security Agents to Mobile Devices. Deploying Mgmt and Security Agents

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

WEB, HYBRID, NATIVE EXPLAINED CRAIG ISAKSON. June 2013 MOBILE ENGINEERING LEAD / SOFTWARE ENGINEER

Learn ios 7 App. Development. James Bucanek. Apress*

ios SDK Release Notes for ios 5.0 beta 3

Designing for the Mobile Web Lesson 3: HTML5 Web Apps

Navigating the Mobile App Development Landscape

Programming 3D Applications with HTML5 and WebGL

How To Use Ios 5

Mobile Application Development

COMMUNITY COLLEGE OF CITY UNIVERSITY CITY UNIVERSITY OF HONG KONG. (English) Application for Portable Devices (Chinese)

MEAP Edition Manning Early Access Program Hello! ios Development version 14

Penetration Testing for iphone Applications Part 1

COMPARING APPLE S IOS WITH SAMSUNG S BADA MOBILE SOFTWARE DEVELOPMENT PLATFORMS

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

JavaScript Patterns. Stoyan Stefanov. O'REILLY' Beijing Cambridge Farnham Koln Sebastopol Tokyo

Choosing a Mobile Strategy for Your Business

Learning Web App Development

Your First App Store Submission

CSCI E-65: Mobile Application Development Using Swift and ios

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

ANDROID INTRODUCTION TO ANDROID

QML and JavaScript for Native App Development

CHAPTER 1: INTRODUCTION TO ANDROID, MOBILE DEVICES, AND THE MARKETPLACE

Mobile Application Development ITP 342 (3 Units)

INTERMEDIATE ANDROID DEVELOPMENT Course Syllabus

Step-by-Step Setup Guide Wireless File Transmitter

ios How to Back Up from icloud

IDIS Mobile ios. Operation Manual. Powered by

Mobile Application Development ITP 342 (3 Units)

Native mobile apps: The wrong choice for business?

Mobile Game and App Development the Easy Way

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

Can the app be installed on the device? Does the app behave as designed/desired if there is an incoming call?

Mac OS X Lion Server

Setting up Channel-21 Secure RSS CEP on

Frequently Asked Questions for the USA TODAY e-newspaper

Mobile Iron User Guide

Mobile Communicator for Mobile Devices

Store & Share Quick Start

geniusport mobility training experts

Mobile application testing is a process by which application software developed for hand held mobile devices is tested for its functionality,

[PACKTl. Flash Development for Android Cookbook. Flash, Flex, and AIR. Joseph Labrecque. Over 90 recipes to build exciting Android applications with

Assignment 1: Matchismo

E-commerce: Competing the Advantages of a Mobile Enterprise

DeviceAnywhere Enterprise. ios Device Onboarding Guide

Cloud Services MDM. ios User Guide

separate the content technology display or delivery technology

Smart Phones Application development using HTML5 and related technologies: A tradeoff between cost and quality

ITP 342 Mobile App Development. Notifications

Deploying iphone and ipad Mobile Device Management

All About Android WHAT IS ANDROID?

Web Development Life Cycle

Transcription:

SECOND EDITION Learning ios Programming Alasdair Allan Beijing Cambridge Farnham Koln Sebastopol O'REILLY Tokyo

Table of Contents Preface ix 1. Why Go Native? 1 The Pros and Cons 1 Why Write Native Applications? 2 The Release Cycle 3 Build It and They Will Come 4 2. Becoming a Developer 7 Registering as an ios Developer 7 Enrolling in the ios Developer Program. 9 The Mac Developer Program 10 the ios SDK 11 Installing What Happens When There Is a Beta? 13 Preparing Your ios Device 14 Creating a Development Certificate 15 Getting the UDID of Your Development Device 17 Creating an App ID 18 Creating a Mobile Provisioning Profile 19 Making Your Device Available for Development 20 3. Your First ios App 23 Objective-C Basics 23 Object-Oriented Programming 23 The Objective-C Object Model 25 The Basics of Objective-C Syntax 27 Creating a Project 28 Exploring the Project in Xcode 32 Our Project in Interface Builder 39 Building Connecting the User Interface 41 the User Interface to the Code 42 iii

Table Running the Application in the Simulator 46 Putting the Application on Your iphone 48 4. Coding in Objective-C 49 Declaring and Defining Classes 49 Declaring a Class with the Interface 49 Defining a Class with the Implementation 51 Object Typing 52 Properties 52 Synthesizing Properties 54 The Dot Syntax 54 Declaring Methods 54 Calling Methods 55 Calling Methods on nil 56 Memory Management Creating Objects The Autorelease Pool 57 The alloc, retain, copy, and release Cycle 58 Automatic Reference Counting 59 The dealloc Method 60 Responding to Memory Warnings 60 Fundamental ios Design Patterns 60 The Model-View-Controller Pattern 61 Views and View Controllers 61 The Delegates and DataSource Pattern 62 Conclusion 63 56 57 5. Table View-Based Applications 65 Creating the Project 65 Creating a Table View 66 Running the Code 71 Populating the Table View 71 Building a Model 73 Adding Cities to the Guide 78 Adding Images to Your Projects 80 Connecting the Controller to the Model 81 Mocking Up Functionality with Alert Windows 84 Adding Navigation Controls to the Application 85 Adding a City View 87 Edit Mode 94 Deleting a City Entry 98 Adding a City Entry 99 The "Add New City" Interface 102 iv of Contents

Capturing the City Data 109 6. Other View Controllers 115 Utility Applications 115 Making the Battery Monitoring Application 116 Tab Bar Applications 127 Adding Combining Another Tab Bar Item 128 View Controllers 132 Modal View Controllers 137 Modifying the City Guide Application 139 The Image Picker View Controller 148 Adding the Image Picker to the City Guide Application 148 Master-Detail Applications 157 Creating a Universal Application 158 Popover Controllers 167 7. Connecting to the Network 169 Detecting Network Status 169 Apple's Reachability Class 169 Embedding a Web Browser in Your App 181 A Simple Web View Controller 182 Displaying Static HTML Files 191 Getting Data Out of a UlWebView 192 Sending Email 192 Getting Data from the Internet 198 Synchronous Requests 198 Asynchronous Requests 198 Using Web Services 199 8. Handling Data 219 Data Entry 219 UITextField and Its Delegate 219 UITextView and Its Delegate 221 Parsing XML 223 Parsing XML with libxml2 224 Parsing XML with NSXMLParser 225 Parsing JSON 227 NSJSONSerialization 227 The JSON Framework 229 Retrieving Twitter Trends 230 Using the Twitter Framework 232 The Twitter Trends Application 232 Regular Expressions 240 Table of Contents v

Introduction to Regular Expressions 240 Storing Data 245 Using Flat Files 245 Storing Information in a SQL Database 246 Core Data 254 9. Using Sensors 255 Hardware Support 255 Network Availability 256 Camera Availability 256 Audio Input Availability 256 GPS Availability 257 Magnetometer Availability 257 Setting Required Hardware Capabilities 258 Persistent WiFi 258 Background Modes 259 Differences Between iphone and ipad 260 Using the Camera 261 The Core Motion Framework 262 Pulling Motion Data 262 Pushing Motion Data 263 The Accelerometer 264 The Gyroscope 268 The Magnetometer 270 Accessing the Proximity Sensor Using Vibration 275 277 10. Geolocation and Mapping 279 The Core Location Framework Device Heading 281 Location-Dependent Weather 283 Reverse Geocoding 284 Forward Geocoding 284 CLPlacemark Objects 285 Modifying the Weather Application 285 User Location and MapKit 293 Annotating Maps 301 279 11. Introduction to icioud 309 How Can I Use icioud? icioud Backup 310 Provisioning Your Application for icioud 310 Using Key-Value Storage 313 309 vi Table ofcontents

Wrapping Up 320 12. Integrating Your Application 323 Application Preferences 323 The Accounts Framework 333 The Twitter Framework 335 Sending Tweets 336 Custom URL Schemes 337 Using Custom Schemes 337 Registering Custom Schemes 339 Media Playback 344 Using the Address Book 349 Interactive People Picking 349 Programmatic People Picking 353 Sending Text Messages 353 13. Distributing Your Application 355 Adding Missing Features 355 Adding an Icon 355 Adding a Launch Image 359 Changing the Display Name 364 Enabling Rotation 365 Building and Signing 366 Ad Hoc Distribution 367 Developer-to-Developer Distribution 372 App Store Distribution 373 Submitting to the App Store 374 Building Your Application for App Store Distribution 380 The App Store Resource Center 383 Reasons for Rejection 384 14. Going Further 389 Cocoa and Objective-C 389 The ios SDK 389 Web Applications 390 PhoneGap 390 Core Data 391 In-App Purchase 391 MKStoreKit 392 Core Animation 392 Game Kit 392 Writing Games 393 Look and Feel 393 Table of Contents vii

Hardware Accessories 394 Index 395 viil Table of Contents