depicus

changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

Show me the next iView

July 31, 2010 by The Man

Because I always forget ….

1. In the starting .h file

#import "frmMain.h"
@interface frmStart : UIViewController 

2. In the starting form .m file

#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

#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

@protocol frmMainDelegate;

@interface frmMain : UIViewController {
    id  delegate;
    UIWindow *window;
    UITabBarController *tabBarController;
}

@property (nonatomic, assign) id  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

@synthesize delegate;