I am using XCode 4.
In My applicaion
I have Files
- WelcomeViewController
- FirstViewController
- SecondViewController
- ThirdViewController
In every view I have same functionality.
Pressing the Button and Load another view By presentModelViewController..
Problem I am Facing is I can not Declare Two outlets in One header file As If I want to move to the Back Page.?
#import <UIKit/UIKit.h>
#import "ThirdViewController.h"
#import "FirstViewController.h"
@interface SecondViewController : UIViewController {
UIButton *button1;
}
@property (nonatomic,retain) IBOutlet ThirdViewController *thirdVC;
@property (nonatomic,retain) IBOutlet FirstViewController *firstVC;
//Error at this line above
@property (nonatomic,retain) IBOutlet UIButton *button1;
@end
Is it a good practice to alloc and init the new controller or I just have to take a view controller in XIB file and then just create Outleyts???
Yes you are right definbately, I have tried it is working…but why I am taking View Controller because I just can jump to previous to previous view ? What is wrong If I take an IBOutlet.???
So, What if I want to move previous to previous view I need to write
two times
[self dismisviewContrlloer animated:YES];
[self dismisviewContrlloer animated:YES];
????
Why would you want to have 3 outlets? Just have properties for the viewcontroller. Alloc and init and present the views of the same controller class.
So basically you will have a xib file for a viewcontroller and you will need to create as many instances of that depending on your requirement. Looking at the code i think it needs lot of redesign. You present and dismiss these views accordingly.