I'm new to Objective-C and have a little bit of problem. I made an app that has a button that switches to tab number 2 in the app but I want it to get specific data from the database so I've written code in which I pass from the first view a number which is the id of the row I need to the second view
@synthesize goTo;
-(IBAction)goToChapter:(id)sender{
self.goTo= (int)10 ;
self.tabBarController.selectedViewController
= [self.tabBarController.viewControllers objectAtIndex:1];
}
So in the second class i tried this:
- (void)viewDidLoad {
[super viewDidLoad];
FirstViewController *fvc=[[FirstViewController alloc] init];
int inx = (int)fvc.goTo ;
[self getPageContent:inx];
}
but what I got is that the goTo is with a zero not 10 as suppose to be. What am I doing wrong and how can this be handled?
Thanks in advance :)
Emad Hegab