In my code, I’ve customized the initWithNibName to receive some data it needs to do it’s thing. Here’s the code:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil theArray:(NSArray *)theDataArray theVal:(NSInteger)theDataValue bRange:(BOOL)isRange bColor:(BOOL)isColor{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.data = theDataArray;
self.selectedValue = theDataValue;
NSLog(@"NCG - initWithNibName setting selectedValue = %d.", self.selectedValue);
//self.originalValue = theDataValue;
self.isTheRange = isRange;
self.isTheColor = isColor;
self.selectedIndex = [self indexFromValue:theDataValue bRange:self.isTheRange bColor:self.isTheColor];
self.doneClicked = NO;
//NSLog(@"Selected Row = %d.", self.selectedIndex);
}
return self;
}
When this view runs, it updates self.selectedValue to a new value. I need this value in the view that pushed this view once this view is popped.
How do I get this data?
When I have this I usually have a ‘parentReference’ data member
ex:
//while ‘B’ class is declared like
that way, you can go back to the class that ‘summoned’ you and do whatever you want
(you might think that
[self.view superview] == parentRef, but that’s not true)