Laboratory‎ > ‎Objective-C‎ > ‎

Splash Hoonio

SplashHoonio.pngThis program simply displays a logo on the iPhone screen.

 

 

SplashHoonioAppDelegate.h

- (IBAction)flashWindow;
- (IBAction)printValue:(id)sender;
- (IBAction)printValue:(id)sender withEvent:(UIEvent *) event;

 

 

SplashHoonioAppDelegate.m

- (void)applicationDidFinishLaunching:(UIApplication *)application {    
 
    // Override point for customization after application launch
    [window makeKeyAndVisible];
	NSLog(@"App was initialized");
}
 
- (void)application:(UIApplication *)application 
    willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation 
    duration:(NSTimeInterval)duration {
	NSLog(@"will change status bar orientation to %d", newStatusBarOrientation);
}
 
- (void)awakeFromNib{
	slider.value = 5;
	label.text = @"I'm Awake!";
}
 
- (IBAction)flashWindow{
	static int counter = 0;
	if (counter++ % 2)
		window.backgroundColor = [UIColor redColor];
	else {
		window.backgroundColor = [UIColor blueColor];
	}
}
 
- (IBAction)printValue:(id)sender{
	UISlider *slider = (UISlider *)sender;
	label.text = [NSString stringWithFormat:@"%f", slider.value];
}
 
- (IBAction)printValue:(id)sender withEvent:(UIEvent *) event{
	label.text = [NSString stringWithFormat:@"sender = %@", event];
}
Comments