Académique Documents
Professionnel Documents
Culture Documents
Stanford
CS193p
Fall 2010
Today
Logistics
Lectures
Communication
Homework / Final Project
Requirements
iOS Overview
MVC
Object-Oriented Design Concept
Stanford
CS193p
Fall 2010
Logistics
Lectures Homework
Tell you (Tuesday) 7 weekly assignments
Show you (Thursday) Assigned Thursday after lecture
Let you do it yourself (Homework) Due the following Wednesday at 11:59pm
Individual work only
Friday TA Section
Practical matters (e.g. debugging) Final Project
KPCB Entrepreneurship 3 weeks to work on it
Special topics (guest lecturers) Proposal requires instructor approval
Some teams of 2 might be allowed
Communication
Keynote presentation required (3 mins or so)
http://cs193p.stanford.edu
Lectures, demo code and homework
Class announcements
Stanford
CS193p
Fall 2010
Requirements
Must have a Mac Object-Oriented Terms
Intel-based Class (description/template for an object)
Snow Leopard Instance (manifestation of a class)
Message (sent to objects to make them act)
Hardware Method (code invoked by a Message)
Not required for homework
Instance Variable (object-specific storage)
Required for final project (iOS4 or iPad)
Inheritance (code-sharing mechanism)
iPod Touch loaners available
Superclass/Subclass (Inheritance relationships)
Textbook Protocol (non-class-specific method declaration)
Apple on-line documentation
http://developer.apple.com You should know these!
If you are not very comfortable with all of
Prerequisites these, this might not be the class for you
Object-Oriented Programming
CS106A&B required, CS107 recommended Stanford
CS193p
Fall 2010
iOS4 SDK
Required for all homework assignments and final project
It’s free!
Download Xcode/SDK from iOS Dev Center at http://developer.apple.com
To run on a device (not just in simulator), you must join a Program
iOS Developer University Program = free for Stanford students = Device YES, AppStore NO
Normal Developer Program = $99/year = Device YES, AppStore YES
Stanford
CS193p
Fall 2010
What will I learn in this course?
How to build cool apps
Easy to build even very complex applications
Result lives in your pocket!
Very easy to distribute your application through the AppStore
Vibrant development community
Stanford
CS193p
Fall 2010
iOS
Core OS
Cocoa Touch
OSX Kernel Power Management
Media Mach 3.0 Keychain Access
BSD Certificates
Core Services
Sockets File System
Core OS Security Bonjour
Stanford
CS193p
Fall 2010
iOS
Core Services
Cocoa Touch
Collections Core Location
Media Address Book Net Services
Networking Threading
Core Services
File Access Preferences
Core OS SQLite URL Utilities
Stanford
CS193p
Fall 2010
iOS
Media
Cocoa Touch
Core Audio JPEG, PNG, TIFF
Media OpenAL PDF
Audio Mixing Quartz (2D)
Core Services
Audio Recording Core Animation
Core OS Video Playback OpenGL ES
Stanford
CS193p
Fall 2010
iOS
Cocoa Touch
Cocoa Touch
Multi-Touch Alerts
Media Core Motion Web View
View Hierarchy Map Kit
Core Services
Localization Image Picker
Core OS Controls Camera
Stanford
CS193p
Fall 2010
Platform Components
Interface Builder
Tools e nts
r u m
Xcode Inst
ata Cor
e
D Mot
o re ion
C
Frameworks Ma
p
Kit
Foundation UIKit
Design Strategies
MVC Stanford
CS193p
Fall 2010
MVC
Controller
Model View
Stanford
CS193p
Fall 2010
MVC
Controller
Model View
Controller
Model View
Controller
Model View
Controller
Model View
Controller
Model View
Controller
Model View
Controller
outlet
Model View
Controller
outlet
Model View
The Model and View should never speak to each other. Stanford
CS193p
Fall 2010
MVC
Controller
?
outlet
Model View
Controller
outlet
Model View
Controller
outlet
Model View
Controller
outlet
action
Model View
Controller
outlet
action
Model View
The View sends the action when things happen in the UI. Stanford
CS193p
Fall 2010
MVC
target
Controller
outlet
action
should
will did
Model View
Controller
outlet
de
le
atg
action
e
Model View
Controller
outlet
de
le
atg
action
e
Model View
The delegate is set via a protocol (i.e. it’s “blind” to class). Stanford
CS193p
Fall 2010
MVC
should target
will did
Controller
outlet
de
le
atg
action
e
Model View
Controller
outlet
de
le
atg
action
e
Model data View
count
at
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Controllers are almost always that data source (not Model!). Stanford
CS193p
Fall 2010
MVC
should target
will did
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Controller
data outlet
?
count
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
ta
le
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Controller
data
count
outlet
at
da
de
Notification
ta
le
& KVO
g
so
at
u action
e
rc
e
Model View
Stanford
CS193p
Fall 2010
MVCs not working together
Stanford
CS193p
Fall 2010
Coming Up
Next Lecture
Overview of the Development Environment
Xcode
Objective-C intro
Interface Builder
Concrete example of MVC
Major demonstration of all of the above: Calculator
Friday (optional)
Installing the SDK and using the debugger (this is the only time that will be covered)
Next Week
Objective-C language in depth
Foundation classes: arrays, dictionaries, strings, etc.
Dynamic and static typing
Stanford
Memory Management CS193p
Fall 2010