setting a table view that leads to data from Core Data
I am trying to set a table view that calls a few data from core data. For example:
1st. Table View = 1. Food, 2. Places, 3. Sports
开发者_运维知识库when i click food, it will take data from Core Data and call out for instance :-
Food > 1.Burger, 2. Fries, 3. Chicken Chop
when i press back, it will go back to the main page which has the tree instances which are food, places and sport.
Thanks in advance.
How am i gonna link both of them?
You have to use 4 classes for this,
RootViewController for 1st UITableView (Food,Place,Sports).
FoodTableView Class for Food details,
PlaceTableView Class for Place details,
SportsTableView Class for Sports details.
In RootView TableView link those class in didSelectRowAtIndexPath method.
Eg.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0 ) {
// link Food class
}
else if (indexPath.row == 1) {
// link Place Class
}
else if (indexPath.row == 2) {
// link Sports Class
}
}
精彩评论