More Related Content Similar to iPhone Development Intro (20) iPhone Development Intro7. Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection
account
8. Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection
account
9. Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
account
10. Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
account
• Code
11. Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
account
• Code
• Profit?
20. C Smalltalk
Objective-C
21. C Smalltalk
Objective-C
C++
22. C Smalltalk
Objective-C
C++
Java C#
23. C Smalltalk
Objective-C
C++
Java C#
24. C Smalltalk
Objective-C
C++
Java C#
33. Files
• .h - Header files
• .m - Class implementation files
41. .m file
- (id) thisIsAMethod:(int)param1
options:(float)param2
42. .m file
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
43. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
@end
44. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
@class options:(float)param2
@interface
{
@end
for (int n = 0; n < 10; ++n)
{ @property
NSLog(@”N=%d”, n);
@private
[object callMethod:1 thing:2];
} @protected
}
@end
45. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
@end
46. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
@end
47. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
@end
48. .m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
options:(float)param2
{
for (int n = 0; n < 10; ++n)
{
NSString
NSLog(@”N=%d”, n);
[object callMethod:1 thing:2];
}
}
@end
62. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
63. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Media
64. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
65. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
Core Services
66. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
Core Data, Core
Core Services Foundation, Address Book
Framework
67. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
Core Data, Core
Core Services Foundation, Address Book
Framework
Core OS
68. iOS Frameworks
UIKit, MapKit, Printing,
Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
Core Data, Core
Core Services Foundation, Address Book
Framework
Core OS Posix Threads, SQLite
69. iOS Frameworks
UIKit, MapKit, Printing,
Objective C Cocoa Touch Gesture Recognizers
Core Audio, Open GL ES,
Media Quartz, Core Animation
Core Data, Core
Core Services Foundation, Address Book
Framework
C Core OS Posix Threads, SQLite
82. Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
83. Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
• Can be created programatically or with
Interface Builder
84. Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
• Can be created programatically or with
Interface Builder
• Can be animated using Core Animations
90. ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
• Provides all the logic to bridge data from
the model and the view
• Loads Views
91. ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
• Provides all the logic to bridge data from
the model and the view
• Loads Views
• Implements the code to handle actions
triggered by touch events on views
96. .XIB Files
• Interface Builder XML GUI spec files
• Connects from IB to the Code
• Only on iOS. At build time are converted
to NIB files