J'ai un tableau mis en place comme:Accéder aux objets dans un tableau?
NSMutableArray *array = [[NSArray alloc] initWithObjects: @"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", nil];
Et je voudrais accéder au contenu du tableau pour les afficher dans une NSString mais je ne suis pas sûr ce qu'il faut utiliser, par exemple:
[NSString stringWithFormat:@"%c", [objectAtIndex:0]];
[NSString stringWithFormat:@"%c", [objectAtIndex:1]];
Mais mon tableau est déclaré en - (void)viewDidLoad
et je dois y accéder en - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- Comment y accéder et les afficher dans un NSString?
Vous devez placer 'array' une instance var. Voir http://stackoverflow.com/questions/6851963/question-about-instantiating-object/6852037#6852037 – David