.h
Code:
#import <UIKit/UIKit.h>
@interface MyViewController : UIViewController {
IBOutlet UIImageView *Image;
}
-(IBAction)GoBack;
@end
.m
Code:
#import "MyViewController.h"
@implementation MyViewController
-(IBAction)GoBack;
{
[self dismissModalViewControllerAnimated:YES];
}
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidLoad {
Whale.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"My 01.png"],
[UIImage imageNamed:@"My 02.png"],
[UIImage imageNamed:@"My 03.png"],
[UIImage imageNamed:@"My 16.png"],nil];
[My setAnimationRepeatCount:1];
My.animationDuration = 5;
[My startAnimating];
[self performSelector:@selector(GoBack) withObject:nil afterDelay:5.0f];
[super viewDidLoad];
}
- (void)dealloc {
[Whale release];
[super dealloc];
}
@end