I have got two view controllers say NewGroupView
and GroupsTabView
. I have to set bool value of second view controller from my first view controller. This is how im setting the values of the second view controllers from my first view controller.
NewGroupView *groupView = [self.storyboard instantiateViewControllerWithIdentifier:@"NewGroupViewNC"];
NewGroupView *ngv = [NewGroupView new];
ngv->isGroupViewMode=YES;
groupView.isGroupViewMode = YES;
[self presentViewController:groupView animated:YES completion:nil];
Following is the interface declaration of my second view controller.
@interface NewGroupView : UIViewController<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,assign) BOOL isGroupViewMode;
@end
in my viewDidLoad method, I tried it print it as follows,
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(isGroupViewMode ? @"Yes" : @"No");
}
But the issue is that it is always printing NO though I have set it to be YES. why is that the assigned value is not persisting?