Archive for July, 2010
Show me the next iView
Saturday, July 31st, 2010
Because I always forget ….
1. In the starting .h file
View Code OBJC
1 2 | #import "frmMain.h" @interface frmStart : UIViewController <frmMainDelegate> |
2. In the starting form .m file
View Code OBJC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #import "frmMain.h" @synthesize delegate; -(void) onPressMain { NSString *nibVersion = @"frmMain"; if (iPadCheck) { NSLog(@"Is an iPad"); nibVersion = @"frmMainiPad"; } frmMain *controller = [[frmMain alloc] initWithNibName:nibVersion bundle:nil]; controller.delegate = self; controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:controller animated:YES]; } |
2. In the starting .h file
View Code OBJC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #import "frmMain.h" -(void) onPressMain { NSString *nibVersion = @"frmMain"; if (iPadCheck) { NSLog(@"Is an iPad"); nibVersion = @"frmMainiPad"; } frmMain *controller = [[frmMain alloc] initWithNibName:nibVersion bundle:nil]; controller.delegate = self; controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:controller animated:YES]; } - (void)frmMainDelegateDidFinish:(frmMain *)controller { [self dismissModalViewControllerAnimated:YES]; } |
3. In the main .h file
View Code OBJC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | @protocol frmMainDelegate; @interface frmMain : UIViewController { id <frmMainDelegate> delegate; UIWindow *window; UITabBarController *tabBarController; } @property (nonatomic, assign) id <frmMainDelegate> delegate; @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; @end @protocol frmMainDelegate - (void)frmMainDelegateDidFinish:(frmMain *)controller; @end |
4. In the main .m file
View Code OBJC
1 | @synthesize delegate; |






