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 :

http://developer.apple.com/library/ios/#samplecode/tableviewsuite/introduction/intro.html%23//apple_ref/doc/uid/dts40007318

good luck


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -