ios - Going into a second table view when i click on a table view cell of a first table view? -


hi i'm working on standard master-detail applicaton.

when create master-detail application in xcode (i mean 1 propose when creating new project), xcode creates navigation controller, table view , detail view, default behavior when click uitableview cell go on detail view. instead go on table view (that of course had created in storyboard). purpose show list of filtered values ​​on basis of clicked (the cell clicked) on first table view.

so try accomplish graphical storyboard, try ctrl-drag arrow first-standard table view second-new one. selecting manual segue = show. , deleted "original" arrow link first-standard table view detail view (the 1 proposed xcode).

but when click on table view cell in simulator, clicked cell becomes gray , nothing happens.

how can make second filtered table view appear when click on first' table view cell? should accomplish this?

ps. beginner of ios programming, objective-c , cocoa touch framework. xcode tag because know can done within storyboard (graphically) accomplish need do.

if want show "detail" table view when click onto "master" table view cell can ctrl-drag. start prototype cell (selecting it) of master view second table view, in storyboard, choose show detail option create segue.

click on segue , check name in attributes inspector, should showdetail , in masterviewcontroller.swift file should @ function, in prepareforsegue can set filtered results: also: setdetailitem:object should changed function, since tableview scene have created not have detailitem property , can add property in h file , set prepareforsegue

#pragma mark - segues  - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {     if ([[segue identifier] isequaltostring:@"showdetail"]) {         nsindexpath *indexpath = [self.tableview indexpathforselectedrow];         nsdate *object = self.objects[indexpath.row];         [[segue destinationviewcontroller] setdetailitem:object];     } } 

Comments