2. iOS Development
• About Me:
• Pat Zearfoss
• Mindgrub Technologies, LLC
• BS Computer Science - UMBC 2008
• Working with mobile and iOS for 3
years.
3. iOS Development
• Web:
pzearfoss@gmail.com
http://zearfoss.wordpress.com
@pzearfoss
http://www.github.com/pzearfoss
10. HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
distributed on the app store.
11. HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
distributed on the app store.
• Limited use of device hardware.
12. HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
distributed on the app store.
• Limited use of device hardware.
• Cross Platform
13. HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
distributed on the app store.
• Limited use of device hardware.
• Cross Platform
• Except for all the cross browser
problems you already know and love.
16. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
17. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
18. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
19. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
20. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
• “Cross Platform”
21. Cross Platform
Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
• “Cross Platform”
• Your mileage may vary.
24. Native
• Offers the most control over your product.
• Access to all device frameworks.
25. Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
26. Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
• Only runs on iOS (obviously)
27. Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
• Only runs on iOS (obviously)
• Will generally run with the absolute best
performance.
41. Getting Started
• Recommended but not required
• Some knowledge of C
• malloc() . . . free() ?
• Some knowledge of design patterns:
42. Getting Started
• Recommended but not required
• Some knowledge of C
• malloc() . . . free() ?
• Some knowledge of design patterns:
• MVC, Singleton, Delegation
50. Obj-C in 10 minutes
• All the things you know from C
51. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
52. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
• int, float, double, char
53. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
• int, float, double, char
int foo = 5;
54. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
• int, float, double, char
int foo = 5;
• Separate compilation
55. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
• int, float, double, char
int foo = 5;
• Separate compilation
• .h for interface declaration
56. Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
• int, float, double, char
int foo = 5;
• Separate compilation
• .h for interface declaration
• .m for implementation (instead of .c)
58. Obj-C in 10 minutes
• Functions / Methods have return types and
typed arguments
59. Obj-C in 10 minutes
• Functions / Methods have return types and
typed arguments
int sumOfItems(int i, int j)
{
return i + j;
}
60. Obj-C in 10 minutes
• Functions / Methods have return types and
typed arguments
int sumOfItems(int i, int j)
{
return i + j;
}
• Other types
61. Obj-C in 10 minutes
• Functions / Methods have return types and
typed arguments
int sumOfItems(int i, int j)
{
return i + j;
}
• Other types
• void, NULL
62. Obj-C in 10 minutes
• Functions / Methods have return types and
typed arguments
int sumOfItems(int i, int j)
{
return i + j;
}
• Other types
• void, NULL
• pointers to types (int *, void *)
65. Obj-C in 10 minutes
• Objective-C Additions:
• BOOL - YES / NO
66. Obj-C in 10 minutes
• Objective-C Additions:
• BOOL - YES / NO
BOOL isSet = YES;
67. Obj-C in 10 minutes
• Objective-C Additions:
• BOOL - YES / NO
BOOL isSet = YES;
• id - strictly a pointer to an object
68. Obj-C in 10 minutes
• Objective-C Additions:
• BOOL - YES / NO
BOOL isSet = YES;
• id - strictly a pointer to an object
• nil - a zero’d out pointer
69. Obj-C in 10 minutes
• Objective-C Additions:
• BOOL - YES / NO
BOOL isSet = YES;
• id - strictly a pointer to an object
• nil - a zero’d out pointer
• nil != (necessarily) NULL or 0
72. Obj-C in 10 minutes
• Classes
• Exist as a class pair
73. Obj-C in 10 minutes
• Classes
• Exist as a class pair
• Instance variables and instance methods act
on an instance object
74. Obj-C in 10 minutes
• Classes
• Exist as a class pair
• Instance variables and instance methods act
on an instance object
• Class (static) methods act on the class
object
75. Obj-C in 10 minutes
• Classes
• Exist as a class pair
• Instance variables and instance methods act
on an instance object
• Class (static) methods act on the class
object
• There is only ever one class object at any
given time
76. Obj-C in 10 minutes
• Classes
• Exist as a class pair
• Instance variables and instance methods act
on an instance object
• Class (static) methods act on the class
object
• There is only ever one class object at any
given time
• Class variables really don’t exist
77. Obj-C in 10 minutes
• Classes
#import <Foundation/Foundation.h>
@interface MyClass : NSObject
{
id aChildObject;
NSArray *someItems;
}
+ (NSString *)className;
- (void)logMe;
@property (nonatomic, retain) id aChildObject;
@end
78. Obj-C in 10 minutes
• Classes Include a header
#import <Foundation/Foundation.h>
file
@interface MyClass : NSObject
{
id aChildObject;
NSArray *someItems;
}
+ (NSString *)className;
- (void)logMe;
@property (nonatomic, retain) id aChildObject;
@end
102. Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
103. Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
•@
• Objective-C keywords
• Initializer for string constants
104. Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
•@
• Objective-C keywords
• Initializer for string constants
• ‘[]’
• “Send a message to an object”
• Like calling a method, but more dynamic
139. Model
• Defines the data to be displayed in
a view.
• Model objects
• Database
Model
• Web
140. Controller
• Negotiates communication
between the model and the view.
• Controls presentation logic
• Updates the model
Controller
• Reflects those updates on the
view
141. View
• Contains controls and UI Widgets
• Informs the controller of
updates.
View
142. Hello World
Model Controller View
(Hello_WorldViewController) (.xib)
Label
view
143. Hello World
Model Controller View
(Hello_WorldViewController) (.xib)
Label
view
144. Hello World
Model Controller View
(Hello_WorldViewController) (.xib)
Label
view