objective c - prepare push segue from presentviewcontroller using xib ios7 -
how can prepare segue on button click presentviewcontroller using xib objective-c? trying billow given code not working.
pushviewcontroller *puvc=[[pushviewcontroller alloc]initwithnibname:@"pushviewcontroller" bundle:nil]; uinavigationcontroller *nvc = [[uinavigationcontroller alloc] initwithrootviewcontroller:puvc]; [self.navigationcontroller pushviewcontroller:nvc animated:yes];
- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"your_segue_name_here"]) { yourviewcontroller *vc = [segue destinationviewcontroller]; [vc setmyobjecthere:object]; } }
your_segue_name_here identifier of segue set in xib file. helped me. hope helps.
pushviewcontroller *puvc=[[pushviewcontroller alloc]initwithnibname:@"pushviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:puvc animated:yes];
use code
[self presentviewcontroller:navigationcontroller animated:yes completion:nil];
Comments
Post a Comment