Introducing The Iphone Os: 1 Himanshu H Patel
Introducing The Iphone Os: 1 Himanshu H Patel
1 Himanshu H Patel
Architecture Of the i-phone OS
The iPhone OSs frameworks are
divided into four major layers.
3
Architecture Of the i-phone OS
The Cocoa Touch layer sits at the top of the iPhone OS stack
and contains the frameworks that are most commonly used
by iPhone application developers.
Core Animation
Core Audio
Core Data
Stream and play full-screen video within your app. Get full
programmatic control over video playback and capture.
The object is kept alive for the scope of the method that
its been passed to, and then the NSAutoreleasePool
cleans it up.
They are just rules. For instance, every car has wheels,
doors, and a main body color, among many other things.
#import <Foundation/Foundation.h>
#import "Car.h"
@interface Jaguar : NSObject <Car>
@end
In Quiz, the buttons, labels, and the view they are placed
on top of are all view objects.
But the label doesnt know what text it should display, and
the string doesnt know what characters it should store.
67 By: Prof. Himanshu patel
Model-View-Controller
This is where controller objects come in.
Theres only one of them for your application, and its the
overall container for everything that your application
does.
App Delegate
Main
BallShootingViewController
Main Window
App
Delegate
View Controller
Main Window
View Controller
Screen view
89
By: Prof. Himanshu patel
View-based Application Architecture - Main
main Represent as a file main.m
View Controller
Screen view
b. Files Location
d. File text
Editor
Select whether
your app would
like to run in a
real device or
iPhone simulator
BallShooting Icon
b. View
d. Attributes
Inspector
a. Library
c. Components
Open Attribute
Inspector window Here
For example, you can search for NSString in the search field
to look for related functions.
103 By: Prof. Himanshu patel
NSLog Debug Console
Usually, we will add in some screen output in various
parts of the program to perform debugging task. This can
be done by:
Press to pop up the
debug console
window
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation*)newLocation
fromLocation:(CLLocation *)oldLocation
{
}
Steps Involved
Steps Involved
UITableViewDelegate,
UITableViewDataSource
- (IBAction)btnDate:(id)sender
{
NSDate *dt = ViewSelectedDate.date;
NSDateFormatter *formtr = [[NSDateFormatter alloc]init];
formtr.dateStyle = NSDateFormatterShortStyle;
NSString *str = [formtr stringFromDate:dt];
UIAlertView *alt = [[UIAlertView alloc]initWithTitle:@"Date" message:str
delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alt show];
}
Steps Involved
Steps Involved
https://developer.apple.com/library/ios/documentation/Eve
ntHandling/Conceptual/EventHandlingiPhoneOS/Gesture
Recognizer_basics/GestureRecognizer_basics.html