Upload
mkhululi-buzwa
View
319
Download
0
Tags:
Embed Size (px)
DESCRIPTION
ios application developemnt
Citation preview
iOS App DevelopmentLecture 1 - Introduction
Thursday 26 July 12
Acknowledgements
• Slides based on the iOS App Development course at UMBC (http://cs491f10.wordpress.com/)andCS 193P at Stanford University (http://www.stanford.edu/class/cs193p/cgi-bin/drupal/)
Thursday 26 July 12
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
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
Evaluation
• Homework: 20%
• Project: 30%
Thursday 26 July 12
Homework
1. Create “Your first iOS application” & demo to me: 2.5%
2. Write ImageProcessing Application: 17.5%
Thursday 26 July 12
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
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
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
When / Where did it all start?
Thursday 26 July 12
iOS Architecture
Thursday 26 July 12
OS X Architecture
Picture from Wikipedia
Thursday 26 July 12
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
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
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
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
Model View Controller
Controller
View Model
Thursday 26 July 12
A different view
Thursday 26 July 12
Development Stack — Tools
Text
Images from AppleThursday 26 July 12
Development Stack — FrameworksDevelopment Stack — Frameworks
Foundation
UI Kit
Map KitAddress Book
Core Animation
Core Data
OpenGL
Many Others...
Thursday 26 July 12
Development Stack — Language & RuntimeDevelopment Stack — Language & Runtime
Objective-C
Thursday 26 July 12
Hello World in Objective-C & Xcode
Thursday 26 July 12
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
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
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
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
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