ios - Push view of storyboard in accessorybutton tapped -
i have storyboard named "mainstoryboard_iphone.storyboard" , has 2 views. first view has table cell disclosure button. can drag drop table cell other view , show view, need programmatically when user click on accessory button without using segue. name of 2 views rootviewcontroller , providerlookupviewcontroller. have tried code doesnt work, throws error when click on accessory button on cell. commented lines other things tried
-(void)tableview:(uitableview *)tableview accessorybuttontappedforrowwithindexpath:(nsindexpath *)indexpath { uistoryboard* sb = [uistoryboard storyboardwithname:@"mainstoryboard_iphone" bundle:nil]; // providerlookupviewcontroller* vc = [sb instantiateviewcontrollerwithidentifier:@"providerlookupviewcontroller"]; uiviewcontroller* vc = [sb instantiateviewcontrollerwithidentifier:@"providerlookupviewcontroller"]; [self presentmodalviewcontroller:vc animated:yes]; //[self.navigationcontroller pushviewcontroller:vc animated:yes]; }
first give storyboard id providerlookupviewcontroller in scenario , tick use storyboard id then
providerlookupviewcontroller* vc = [self.storyboard instantiateviewcontrollerwithidentifier:@"providerlookupviewcontroller"]; [self presentmodalviewcontroller:vc animated:yes];
note:providerlookupviewcontroller identifier.
Comments
Post a Comment