|
| 1 | +// |
| 2 | +// LazyStartSampleViewController.m |
| 3 | +// LazyStartSample |
| 4 | +// |
| 5 | +// Created by Hiroshi Hashiguchi on 11/02/11. |
| 6 | +// Copyright 2011 . All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +#import "LazyStartSampleViewController.h" |
| 10 | +#import "SubViewController.h" |
| 11 | + |
| 12 | +@implementation LazyStartSampleViewController |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +/* |
| 17 | +// The designated initializer. Override to perform setup that is required before the view is loaded. |
| 18 | +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { |
| 19 | + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; |
| 20 | + if (self) { |
| 21 | + // Custom initialization |
| 22 | + } |
| 23 | + return self; |
| 24 | +} |
| 25 | +*/ |
| 26 | + |
| 27 | +/* |
| 28 | +// Implement loadView to create a view hierarchy programmatically, without using a nib. |
| 29 | +- (void)loadView { |
| 30 | +} |
| 31 | +*/ |
| 32 | + |
| 33 | + |
| 34 | +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
| 35 | +- (void)viewDidLoad { |
| 36 | + [super viewDidLoad]; |
| 37 | +/* |
| 38 | + NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"sleeping..."); |
| 39 | + [NSThread sleepForTimeInterval:25.0]; |
| 40 | + NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"finished"); |
| 41 | + */ |
| 42 | +} |
| 43 | + |
| 44 | +- (void)viewWillAppear:(BOOL)animated |
| 45 | +{ |
| 46 | +// NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"sleeping..."); |
| 47 | +// [NSThread sleepForTimeInterval:25.0]; |
| 48 | +// NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"finished"); |
| 49 | + |
| 50 | +} |
| 51 | +-(IBAction)doit |
| 52 | +{ |
| 53 | + NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"sleeping..."); |
| 54 | + [NSThread sleepForTimeInterval:25.0]; |
| 55 | + NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"finished"); |
| 56 | +} |
| 57 | + |
| 58 | + |
| 59 | +- (void)viewDidAppear:(BOOL)animated |
| 60 | +{ |
| 61 | +// NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"sleeping..."); |
| 62 | +// [NSThread sleepForTimeInterval:25.0]; |
| 63 | +// NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"finished"); |
| 64 | + |
| 65 | + |
| 66 | + SubViewController* viewController = [[SubViewController alloc] init]; |
| 67 | + [self presentModalViewController:viewController |
| 68 | + animated:YES]; |
| 69 | + [viewController release]; |
| 70 | +} |
| 71 | + |
| 72 | +/* |
| 73 | +// Override to allow orientations other than the default portrait orientation. |
| 74 | +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
| 75 | + // Return YES for supported orientations |
| 76 | + return (interfaceOrientation == UIInterfaceOrientationPortrait); |
| 77 | +} |
| 78 | +*/ |
| 79 | + |
| 80 | +- (void)didReceiveMemoryWarning { |
| 81 | + // Releases the view if it doesn't have a superview. |
| 82 | + [super didReceiveMemoryWarning]; |
| 83 | + |
| 84 | + // Release any cached data, images, etc that aren't in use. |
| 85 | +} |
| 86 | + |
| 87 | +- (void)viewDidUnload { |
| 88 | + // Release any retained subviews of the main view. |
| 89 | + // e.g. self.myOutlet = nil; |
| 90 | +} |
| 91 | + |
| 92 | + |
| 93 | +- (void)dealloc { |
| 94 | + [super dealloc]; |
| 95 | +} |
| 96 | + |
| 97 | +@end |
0 commit comments