2010-08-22 5 views
0

Je travaille sur une application pour mon client. Je suis coincé maintenant.Comment créer uiviewtable personnalisé?

Je ne sais pas comment expliquer. Mais j'en fais une image photoshop.

http://i.stack.imgur.com/cV4mL.jpg

  1. robinet utilisateur sur TableCell parent.
  2. Exécutez didSelectRowAtIndexPath: (NSIndexPath *) indexPath. Cellule de sélection de l'utilisateur.
  3. mise à jour des cellules parentes.

Quelqu'un sait comment s'appelle-t-il? Avez-vous un tutoriel pour cela?

Répondre

0

Utilisez UINavigationController avec UITableViewController comme contrôleur racine et lorsque vous plongez plus profondément, instanciez un UITableViewController différent pour cela et poussez-le sur la pile de navigation. Popping est similaire.

Il existe de bons exemples pour UINavigationController accessible depuis les documents d'Apple.

+0

bonjour Eiko, savez-vous comment mettre à jour les données? de 3 à 1? – neotorama

1
// FirstViewController (1st in your Photoshop-design) 

... 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    SecondViewController *secondViewController = [[SecondViewController alloc] init]; 
    secondViewController.cell = [tableView cellForRowAtIndexPath:indexPath]; 
    [self.navigationController pushViewController:secondViewController animated:YES]; 
} 

... 

------------------------- 

// SecondViewController.h 

@interface SecondViewController : UITableViewController { 
    UITableViewCell *cell; 
} 

@property (nonatomic, retain) UITableViewCell *cell; 

------------------------- 

// SecondViewController.m 

... 

@synthesize cell; 

... 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    self.cell.detailTextLabel.text = @"Something"; 
    [self.navigationController popViewControllerAnimated:YES]; 
} 

... 
+0

hello tim, savez-vous comment mettre à jour les données? de 3 à 1? – neotorama

Questions connexes