hirevietnamese - lesson 1

24
HIREVIETNAMESE iPhone Training Lesson 1

Upload: levanly

Post on 05-Jul-2015

9.534 views

Category:

Technology


0 download

DESCRIPTION

iPhone App Development Tutorial

TRANSCRIPT

Page 1: HireVietnamese - Lesson 1

HIREVIETNAMESE

iPhone TrainingLesson 1

Page 2: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Contents

Introduction to iPhone Programming1

Getting Setup2

Programming Fundamentals3

Example 14

Exercise 15

Page 3: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Introduction to iPhone Programming

Page 4: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Introduction to iPhone Programming

Based on Objective-C Only one application running at a time (multi-tasking

implemented in OS 4) Only one window Limited Screen Size

480 x 320 pixels (iPhone, 3G, & 3GS) 960 x 640 (iPhone 4G) 1024 x 768 (iPad)

Limited System Resources

Page 5: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Introduction to iPhone Programming

Model – View –Controller (MVC) is the method used for developing a mobile app with XCode: Model holds your application’s data View holds the window, controls and other

UI Controller Binds the model and view

together and decides how to handle user input

Page 6: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Getting Setup

Resources you will need: Beginning iPhone 3 Development

Programming in Objective-C

Textbook

Mac OS 10.6.xand

iOS SDK 2.4.x

Software MAC MiniOr

MacBook Pro

Hardware

Page 7: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

New Project

Page 8: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Tools -> Library

Interface Builder

Page 9: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Key objects in an iOS application

Page 10: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

The Application Life Cycle

Page 11: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming FundamentalsState Description

Not running The application has not been launched or was running but was terminated by the system.

Inactive The application is running in the foreground but is currently not receiving events.

Active The application is running in the foreground and is receiving events.

Background The application is in the background and executing code.

Suspended The application is in the background but is not executing code.

Page 12: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Launching into the active state

Page 13: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Moving from the foreground to the background

Page 14: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Handling application interruptions

Page 15: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Programming Fundamentals

Transitioning from the background to the foreground

Page 16: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Outlets and Actions

Outlet

Page 17: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Outlets and Actions

UI Code

Page 18: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Outlets and Actions

- (IBAction) gotoNext:(NSString*)str;

Page 19: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

View Controllers

Page 20: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

View Controllers

[navigationController pushViewController:viewController]

[viewController addSubView:view]

[self.window addSubview:navigationController.view]

[self.window makeKeyAndVisible]

Page 21: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Example 1

Input name = empty

Tap on display button

Page 22: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Example 1

If name == “HireVietnamese”

Tap on display button

Page 23: HireVietnamese - Lesson 1

HIREVIETNAMESEhttp://www.hirevietnamese.com HIREVIETNAMESE

Exercise 1

Page 24: HireVietnamese - Lesson 1

HIREVIETNAMESE