J'essaie de copier NSMutableArray
à un autre, mais il ne me montre rien au UITableView
:Copie NSMutableArray à un autre
NSMutableArray *objectsToAdd= [[NSMutableArray alloc] initWithObjects:@"one",@"two"];
NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil];
NSMutableArray *list = [[NSMutableArray alloc] init];
[self.list addObjectsFromArray:myArray];
Rien show up! Qu'est-ce qui ne va pas?
Il bloque mon application parce que je n'ai rien à NSMutableArray
Comment puis-je ajouter rien? addobject:nil
ne fonctionne pas, il se bloque l'application:
static NSString * DisclosureButtonCellIdentifier =
@"DisclosureButtonCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
DisclosureButtonCellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier: DisclosureButtonCellIdentifier]
autorelease];
}
NSUInteger row = [indexPath row];
NSString *rowString =nil;
rowString = [list objectAtIndex:row];
cell.textLabel.text = rowString;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
[rowString release];
return cell;
pourquoi quelque chose doit être affiché? postez votre cellForRowAtIndexPath: code de la méthode – Morion
Mise à jour comment puis-je ajouter nil à NSMutableArray avec addObject? Il bloque mon application à cellForRowAtIndexPath – stefanosn