I have one MainWindow.xib file. I have one label and one button on first MainWindow.xib file screen. I have secondview.xib file, i want to load secondview.xib file if user will click on main screen button. I have written a method to load Secondview by the following code..
self.second=[[[SecondWindow alloc]initWithNibName:@" HarbourFront" bundle:nil]autorelease];
from the MainWindow screen.
My interface declaration is,
#import "SecondWindow.h"
@interface TrainingProject_1AppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
SecondWindow *second;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic,retain) SecondWindow *second;
-(IBAction) listTableView:(id) sender;
@end
// Definition in ".m" file
@synthesize second;
-(IBAction) listTableView:(id) sender {
NSLog(@"event called");
self.second=[[[SecondWindow alloc]initWithNibName:@" HarbourFront" bundle:nil]autorelease];
}
I checked that method is getting called but SecondWindow is not loading.
How can I load SecondWindow ?
Try this code:
Hope it helps you….