I am not a beginner but I can't figure out this silly issue. I have Two View Controllers For Example Parent and Child are classes. Parent is a base class and child is a sub class But I can't Inherited any data except these bool.
In Parent Class I use one BOOL
Variable which I declare in Parent.h
@property (nonatomic, assign) BOOL isChange;
After that I synthesis this variable and initialize default False in viewDidLoad
isChange = FALSE;
Now, I use this variable in Child Class and I Change the value to True
Parent.isChange = TRUE;
Before this change I also alloc
and init
Parent Class in Child class.
Parent = [[Parent alloc] init];
But the issue is when I Dismiss this Class and go to Parent Class isChange
value not change.
[self dismissViewControllerAnimated:YES completion:nil];
I checked in Parent Class
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if (isChange == TRUE) { // Here isChange Return NO.
[self refresh:nil];
}
}
I can't figure out my mistake.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…