27
iOS App Development Lecture 1 - Introduction Thursday 26 July 12

Ios part1

Embed Size (px)

DESCRIPTION

ios application developemnt

Citation preview

Page 1: Ios part1

iOS App DevelopmentLecture 1 - Introduction

Thursday 26 July 12

Page 3: Ios part1

Course Description• This course provides a study of the design,

development and publication of object-oriented applications for iOS platforms (e.g. iPhone, iPod touch & iPad) using the Apple SDK. Students will learn to utilise Objective-C and the various SDK frameworks to build iPhone & iPod touch applications under Mac OS X.

• Prerequisites: RW 214 and RW 344

• Recommended: Competency in C or C++ (pointers, memory management, etc.)

Thursday 26 July 12

Page 4: Ios part1

Course Objectives

• Gain an understanding of the Objective-C language

• Become familiar with the Apple development tools

• Understand and apply design patterns in order to build mobile applications

• Understand and utilise hardware emerging in today’s mobile devices

• Be able to utilise core frameworks of iOS

Thursday 26 July 12

Page 5: Ios part1

Evaluation

• Homework: 20%

• Project: 30%

Thursday 26 July 12

Page 6: Ios part1

Homework

1. Create “Your first iOS application” & demo to me: 2.5%

2. Write ImageProcessing Application: 17.5%

Thursday 26 July 12

Page 7: Ios part1

Project

• Theme: Mobile for African problems

• Functional specification (What): 5%

• Compare to existing products (Why)

• Task list with milestones and deadlines, mockup: 5%

• Final project and demo: 20%

Thursday 26 July 12

Page 8: Ios part1

Grading Criteria

• Correctness of App

• Appearance of App

• Adherence to Objective-C and iOS coding conventions

• Neatly formatted and indented code

• Well documented header files

• Absence of significant performance issues

• Absence of memory leaks

Thursday 26 July 12

Page 9: Ios part1

iOS Developer University Program

• Apple has a free iOS University program that provides more benefits than the free registration, including:

• Free on-device development

• Developer forum access

• We will be participating in this program this semester, so if you have an iPhone, iPod touch or iPad, you’ll be able to install and run your apps on-device

Thursday 26 July 12

Page 10: Ios part1

When / Where did it all start?

Thursday 26 July 12

Page 11: Ios part1

iOS Architecture

Thursday 26 July 12

Page 12: Ios part1

OS X Architecture

Picture from Wikipedia

Thursday 26 July 12

Page 13: Ios part1

Core OSOSX KernelMach 3.0BSDSocketsSecurity

Power ManagementKeychain AccessCertificatesFile SystemBonjour

iOSCocoa Touch

Media

Core Services

Core OS

StanfordCS193p

Fall 2010

Core OSCore OS

OS X KernelPower Management

Mach 3.0Keychain Access

BSD Certificates

Sockets File System

Security Bonjour

Thursday 26 July 12

Page 14: Ios part1

Core OSOSX KernelMach 3.0BSDSocketsSecurity

Power ManagementKeychain AccessCertificatesFile SystemBonjour

iOSCocoa Touch

Media

Core Services

Core OS

StanfordCS193p

Fall 2010

Core ServicesCore Services

Collections Core Location

Address Book Net Services

Networking Threading

File Access Preferences

SQLite URL Utilities

Thursday 26 July 12

Page 15: Ios part1

Core OSOSX KernelMach 3.0BSDSocketsSecurity

Power ManagementKeychain AccessCertificatesFile SystemBonjour

iOSCocoa Touch

Media

Core Services

Core OS

StanfordCS193p

Fall 2010

MediaMedia

Core AudioJPEG, PNG, TIFF

OpenAL PDF

Audio Mixing Quartz (2D)

Audio Recording

Core Animation

Video Playback

OpenGL ES

Thursday 26 July 12

Page 16: Ios part1

Core OSOSX KernelMach 3.0BSDSocketsSecurity

Power ManagementKeychain AccessCertificatesFile SystemBonjour

iOSCocoa Touch

Media

Core Services

Core OS

StanfordCS193p

Fall 2010

Cocoa TouchCocoa Touch

Multi-Touch Alerts

Core Motion Web View

View Hierarchy

Map Kit

Localisation Image Picker

Controls Camera

Thursday 26 July 12

Page 17: Ios part1

Model View Controller

Controller

View Model

Thursday 26 July 12

Page 18: Ios part1

A different view

Thursday 26 July 12

Page 19: Ios part1

Development Stack — Tools

Text

Images from AppleThursday 26 July 12

Page 20: Ios part1

Development Stack — FrameworksDevelopment Stack — Frameworks

Foundation

UI Kit

Map KitAddress Book

Core Animation

Core Data

OpenGL

Many Others...

Thursday 26 July 12

Page 21: Ios part1

Development Stack — Language & RuntimeDevelopment Stack — Language & Runtime

Objective-C

Thursday 26 July 12

Page 22: Ios part1

Hello World in Objective-C & Xcode

Thursday 26 July 12

Page 23: Ios part1

Hello World

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// insert code here... NSLog(@"Hello, World!");! [pool drain]; return 0;}

Thursday 26 July 12

Page 24: Ios part1

Import Statement

• Exactly like a #include in C/C++, however it ensures that the header is only ever included once

• Foundation/Foundation.h includes many core functions, constants, and objects

#import <Foundation/Foundation.h>

Thursday 26 July 12

Page 25: Ios part1

main

• Exactly like a main section in C or C++

• argc contains the number of command line arguments

• argv is an array of char pointers (C strings)

• main returns a value indicating success or failure

• By convention zero is success, non-zero is failure

int main (int argc, const char * argv[]) { .... return 0;}

Thursday 26 July 12

Page 26: Ios part1

Pools

• These lines allocate an NSAutoreleasePool that is used for memory management

•We’ll cover memory management in some detail in the coming classes, but for now we’ll just be sure to include this code and put our program between these 2 statements

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];...[pool drain];

Thursday 26 July 12

Page 27: Ios part1

NSLog and @“strings”

• NSLog is a function that’s used for printing a string to the console (with some other logging information)

• Note the goofy @ symbol out in front of the double quoted string

• The @ symbol is used to distinguish the string as an Objective-C string (as opposed to a C string)

• NSLog behaves much like C’s printf function in that it can take formatters using % notation and variable number of arguments

NSLog(@"Hello, World!");

Thursday 26 July 12