I've seen some tutorials and read some articles about it, a lot of developers like to do it from a Window base App. Well, I haven't found a way to explain a way to do it from a normal UIViewController and it's nib file. The difference of course is that it does not have a delegate nor window. This links explains it well, but inside a Window base app (http://www.youtube.com/watch?v=HaAPa3gIwMY&feature=related
My question is .. In order for this Switch View to happen in the UIViewController, Do I have to create a Window and add the actions & declarations in the delegate (if so, it will be a mess to be switching around files) or maybe just giving the UIViewController some Protocol Delegate powers, I have no idea.
So, I just want to know how to add a switch (button) to another similar View (same size and all) just with different text or photo. The following code is not working for me (.h) :
and .m
I appreciate any kind of advice, Thank you 
My question is .. In order for this Switch View to happen in the UIViewController, Do I have to create a Window and add the actions & declarations in the delegate (if so, it will be a mess to be switching around files) or maybe just giving the UIViewController some Protocol Delegate powers, I have no idea.
So, I just want to know how to add a switch (button) to another similar View (same size and all) just with different text or photo. The following code is not working for me (.h) :
Code:
@interface CheeseController : UIViewController {
IBOutlet UIView *view1;
IBOutlet UIView *view2;
}
@property (nonatomic, retain) IBOutlet UIView *view1;
@property (nonatomic, retain) IBOutlet UIView *view2;
//Switch views for Detailviews
- (IBAction) SwitchTo1;
- (IBAction) SwitchTo2;
@end
Code:
#import "CheeseController.h"
@implementation CheeseController
@synthesize view1;
@synthesize view2;
-(IBAction)SwitchTo2 {
[view1 setHidden:YES];
[view2 setHidden:NO];
}
-(IBAction)SwitchTo1 {
[view2 setHidden:YES];
[view1 setHidden:NO];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Cheese Cake";
}
@end
Last edited: