ios - call view controller segue from within tableView delegate class -
i have separated tableview delegate , data source tableview controller. far working great. however, have come place need implement didselectrowatindexpath delegate method. when method called need perform segue view controller, dont have reference view controller inside delegate class call method [myviewcontroller performseguewithidentifier...
whats proper way handle this? add property delegate store view controller? not seem idea since view controller has reference delegate already. how can reference vc? thinking post notification there has better way that. ive used view controller delegate have never had deal before.
this question seems strange me because if create segue in storyboard, push segue tableview cell viewcontroller, when tableview cell tapped segue automatically triggered. can other things in
- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender
as
add property delegate store view controller
it's ok. because
@property(nonatomic, assign) id< uitableviewdelegate > delegate
viewcontroller doesn't retain delegate
Comments
Post a Comment