I have implemented 3 UIButtons that represents 3 dates. Depending on which button is selected, I want to display a different UITableView, which represents the selected day schedule of events.
Depending on which button is selected, I hide the other 2 table views.
I have 3 UITableViews, each of which is contained within each UIView, for example, UITableView1 is contained within UIView1 for the selected UIButton1.
How can it be possible to call numberOfSectionsInTableView to return the number of sections depending on which button is selected?
I have something like this:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if (date1Selected == YES && date2Selected == NO && date3Selected == NO)
{
return [date1 count];
}
else if (date1Selected == NO && date2Selected == YES && date3Selected == NO)
{
NSLog(@"test");
return [date2 count];
}
}
However, it never seems to enter the else if.
How can I achieve this?