Tuesday, November 6, 2012

UINavigation Push one ViewController Xib to Another Xib ViewController:




1.AppDelegate.h

@interface SpeedcalcAppDelegate : NSObject <UIApplicationDelegate>
{
UINavigationController *Toggle;

}

2.AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
Toggle=[[UINavigationController alloc]init];
[Toggle setNavigationBarHidden:YES animated:NO];
SpeedcalcViewController *test=[[SpeedcalcViewController alloc]init]; // Created ViewController
[Toggle pushViewController:test animated:NO];
[test release];
[window addSubview:Toggle.view];

}

3.CreatedViewController.m

#import "SpeedcalcViewController.h"
#import "Timecalc.h" // another viewcontroller name


-(IBAction)Toggle_page
{

NSLog(@"called");
Timecalc *Toggle=[[Timecalc alloc]init];
[self.navigationController pushViewController:Toggle animated:NO];
[Timecalc release];
}


No comments:

Post a Comment