iphone - Can't get texts on UITableViewCell -


i want multiple custom texts on cell of uitableview. want these texts after clicking on dynamically added button on cell. can't use didrowselectedatindex method. have own selector executing don't know how can texts on each cell. can me?

thank

  1. make labels global variables
  2. create yur cell default style cell.
  3. add labels contentview of cell without text.
  4. add button.
  5. in method button invokes after click set texts labels.

    uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier] autorelease];  customlabel1 = [[uilabel alloc] initwithframe:cgrectmake(5, 5, 50, 20)]; customlabel2 = [[uilabel alloc] initwithframe:cgrectmake(55, 5, 50, 20)]; [cell.contentview addsubview:customlabel1]; [cell.contentview addsubview:customlabel2]; } 

and

    - (ibaction) click     {         customlabel1.text = @"yaya";         customlabel2.text = @"gaga";     } 

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) -