Sorry for my bad english , and i am very new in ios development. i am trying to add a new IBOutlet for my TutorialChildController which is inherited from UIViewController. My TutorialChildController is in Storyboard and it has UILabel, UIButton, and UIImage. I am creating it dynamically in another ViewController which is rootViewController .The code is calling at viewDidLoad like this:
TutorialChildController *tutorialChildController = [self.storyboard instantiateViewControllerWithIdentifier:@"TutorialChildController"];
here is my TutorialChildController.h :
#import <UIKit/UIKit.h>
@interface TutorialChildController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *startButton;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIImageView *tutorialImage;
@property NSUInteger index;
@property NSString *titleText;
@property NSString *imageFile;
@end
however in TutorialChildController.m i am trying to check my Outlets but my startButton is null.
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"myButton : %@ ", self.startButton); // output is null
NSLog(@"myLabel : %@ ", self.titleLabel); // output is object
}
all IBOutlets linked in storyboard and just startButton is null. I don't know why.
i added some screenshots: