If you are interested in developing internal apps for your business or have a great idea for a commercial app for the App Store but you are not quite sure about where to get started of what is involved.
Our half day seminar covered the following areas:
how to get started with app development,
where to get resources
as well as offering a ‘taster’ module from our 5 day iOS development course
6. What is iPhone SDK?
Layered libraries and frameworks
Development tools
Documentation
Tuesday, 20 March 12
7. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
8. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
9. Core Services Layer
Foundation Framework Objective-C wrappers for Core Foundation
Core Foundation C Library Strings, dates, collections, threads, etc.
Core Location Framework Accessing geospatial positioning info
Core Data Framework Persistence, object-relational mapping
Address Book Framework Managing contact info
SQLite C Library Accessing lightweight SQL database
XML Support ObjC Class NSXMLParser class and libXML2 library
Store Kit Framework In app purchasing
Tuesday, 20 March 12
10. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
11. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
12. Media
Core Animation
Open GL ES
Core Graphics
Core Audio
Tuesday, 20 March 12
13. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
14. iPhone SDK
Cocoa Touch
Media
Core Services
Core OS
Tuesday, 20 March 12
19. XCode
• IDE for iPhone Projects
• Build
• Run (Simulator, device)
• Debug
• Source code
management (SCM)
• Documentation
Tuesday, 20 March 12
20. Interface Builder
• Was a separate application
• Now integrated with Xcode
• GUI design tool
• Doesn't generate code
• Works with ‘Freeze-dried’ objects
• Archived in .xib files
• Dynamically loaded
• Objects deserialized at load
time
Tuesday, 20 March 12
21. Instruments
• Garage Band-style interface
• Performance monitoring
• Recording trace data
• CPU Sampler
• File Activity
• Object Allocations
• Leaks
Tuesday, 20 March 12
22. iOS Simulator
• Simulate iPhone/iPad
• Set the OS Version
• Simulate some hardware features
• Rotate, shake, some gestures
• Network aware
• Home / Lock
• ~/Library/Application Support/iPhone Simulator
Tuesday, 20 March 12
24. Anatomy of an Application iPhone SDK
Tuesday, 20 March 12
25. Anatomy of an Application
• Applications are executed from within a sandbox on the
iPhone
• A Sandbox is a restricted environment
• Prevents applications from accessing unauthorised
resources.
• Prevents read/write operations outside your applications
home folder
• Everything your application needs must be self
contained.
Tuesday, 20 March 12
27. Applications home directory
• Documents
• User created Docs
• Not shared with any other application
• Library
• Application may store preferences
• Other resources
• Has a default Preferences folder
• MyApp.app
• Actual application
• Directory containing executable and other resources
Tuesday, 20 March 12
28. Anatomy of an Application
• Compiled Code
• Your code
• Frameworks
• Nib files
• UI elements and other objects
• Details about object relationships
• Resources
• Images, Sounds, strings etc
Tuesday, 20 March 12
29. La
un
ch
ap
p
Tuesday, 20 March 12
A
pp
in
it
Lo
ad
m
ai
n
ni
b
W
ai
tf
Application Lifecycle
or
ev
en
t
H
an
dle
ev
en
t
Ex
it
ap
p
32. Model, View, Controller
Controller
Logic
Model View
Data Presentation /
interaction
Tuesday, 20 March 12
33. Model
• Manages the app data and state
• Not concerned with UI or presentation
• Often persists somewhere
• Same model should be reusable, unchanged in different
interfaces
Tuesday, 20 March 12
34. View
• Present the model to the user in an appropriate interface
• Allows user to manipulate data
• Does not store any data
• Except to cache state
• Easily reusable & configurable to display different data
Tuesday, 20 March 12
35. Controller
• Intermediary between Model & View
• Updates the view when the model changes
• Updates the model when the user manipulates the view
• Typically where the app logic lives
Tuesday, 20 March 12
37. UIView
• Rectangular region of the screen
• Responsibilities
• Drawing
• Animation
• Responding to Events (touches etc)
• Parent to other views
• Can group other views/objects
Tuesday, 20 March 12
39. View Coordinate System
• Origin in upper left corner
• y-axis grows downwards
0,0
+x
+y
Tuesday, 20 March 12
40. Screen Sizes
iPhone
iPhone 3G/3GS iPhone 4/4S iPad 1/2 New iPad
480 x 320 960 x 640 1024 x 768 2047 x 1536
Tuesday, 20 March 12
41. App - Icons
Size File Name Used For
512 x 512 iTunesArtwork Ad Hoc iTunes
57 x 57 Icon.png Home screen on iPhone/iPod
114 x 114 Icon@2x.png Home screen for iPhone 4
72 x 72 Icon-72.png Home screen for iPad
144 x 144 Icon-72@2x.png Home screen for iPad 3
29 x 29 Icon-Small.png Spotlight and Settings
50 x 50 Icon-Small-50.png Spotlight for iPad compatibility
58 x 58 Icon-Small@2x.png Spotlight and Settings for iPhone 4
Tuesday, 20 March 12
50. Xcode: Workspace
Navigator
Jump Bars
selector bar
Tuesday, 20 March 12
51. Xcode: Workspace
Navigator
Jump Bars
selector bar
Inspector
Selector
bar
Tuesday, 20 March 12
52. Xcode: Workspace
Navigator
Jump Bars
selector bar
Inspector
Selector
bar
Library
Selector
bar
Tuesday, 20 March 12
53. Xcode: Workspace
Navigator
Jump Bars
selector bar
Inspector
Selector
bar
Library
Selector
bar
Filter bar
Tuesday, 20 March 12
54. Xcode - Toolbars
Toolbar
Standard Editor
Assistant Editor
Version Editor
Hide/Show Navigator
Hide/Show Debug
Hide/Show Utilities
Tuesday, 20 March 12
55. Xcode - Toolbars
Navigators
List of files, symbols, search, issues, debug, breakpoint, logs
Jump Bar
Jump to any location in your project
Toolbar
Standard Editor
Assistant Editor
Version Editor
Hide/Show Navigator
Hide/Show Debug
Hide/Show Utilities
Tuesday, 20 March 12
56. Xcode - Interface Builder
Connections
Size Inspector
Attributes
Identity Inspector
Quick Help
File Inspector
Dock
Tuesday, 20 March 12
57. Xcode - Interface Builder
Media
Objects
Code Snippet
File Templates
Tuesday, 20 March 12
58. Create an Xcode Project
• Menu: File > New
Project…
• Xcode displays project
template browser
• Select iOS / Application
• Various iPhone templates
• Click Next…
Tuesday, 20 March 12
65. Target Action
- (IB
Out
let)
Upd
ate
my
Tex
t
- (IBAction)buttonPressed View
Controller
Tuesday, 20 March 12
66. Target Action
- (IB
Out
let)
Upd
ate
my
Tex
t
- (IBAction)buttonPressed View
Controller
Tuesday, 20 March 12
67. Events
• View objects that allows users to initiate some type of action
• Respond to variety of events
• Touch events
• touchDown,touchDragged, touchUp(inside, outside)
• Value changed
• Editing events
• editing began, editing changed, editing ended
Tuesday, 20 March 12
68. Interface Builder Tags
• IBActions
• Associate methods (code) to actions in the UI
• Run some code when button press etc
• IBOutlets
• Associate properties in code with objects in UI
• Get or set a value of a UI object
• Set/Get value of a switch
• Set a view’s hidden propertie
Tuesday, 20 March 12