iphone - How can I move to another view controller when the user clicks on a row? -
i new iphone development, , want move page when user clicks on particular row. so, if click on first row, want page redirect first view controller, , on. each row has own view controller.
first of don't need set different view controller each row (unless have reason doing that).
the correct way set 1 view controller fit cells in raws , change data according selected row.
the way is:
in - didselectrowatindexpath function in implementation file shuld: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { //allocate view controller detailedviewcontroller *detailedviewcontroller = [[detailedviewcontroller alloc] init]; //send properties view controller detailedviewcontroller.property1 = someproperty1; detailedviewcontroller.property2 = someproperty2; //push navigationcontroller [[self navigationcontroller] pushviewcontroller:detailedviewcontroller animated:yes]; [detailedviewcontroller release]; }
i recommend start using apple examples, great , there lot of them :
good luck
Comments
Post a Comment