iphone - how to pass data from one view to another view through parentviewcontroller -
i have data in read.m class. created parent view controller read. so,parent view home.m. in home.m used present modal view controller retailer class. want data read.m retailer.m through home.m.
read.m -(void)requestfromtblviews:(id)navigation forindex:(int)index fortext:(nsstring *)text withdbdata:(nsarray *)dbdata{ [dbdata objectatindex:index]; } -(void)showretailerinfo { //nslog(@"show retailer information is...."); [self.readviewcontent getshowretailerinfo:self]; }
home.m -(void)getshowretailerinfo:(id)currentview; { // nslog(@"get retailer info...."); retailer_info = [[retailerinfoviewcontroller alloc]initwithnibname:@"retailerinfoviewcontroller" bundle:[nsbundle mainbundle]]; retailer_info.view.frame = cgrectmake(0, 0, 320, 480); [retailer_info loaddefaultview]; [self presentviewcontroller:retailer_info animated:yes completion:nil]; [retailer_info release]; }
make values or variables global . declare variables in appdelegate
, import want to. can make singleton class , import values . passing values 1 view other. variables remain same values change according code.
please have here :-
passing data between view controllers
http://oleb.net/blog/2012/02/passing-data-between-view-controllers/
Comments
Post a Comment