2
Je dois enregistrer des données de 2 tableaux à document dir, le premier a été enregistré, mais le second pas !!Enregistrer 2 données NSArray à 2 fichiers dans NSDocumentDirectory
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
NSString *documentsDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSString *rangePath = [documentsDir stringByAppendingPathComponent:@"Range.plist"];
NSString *indexPath = [documentsDir stringByAppendingPathComponent:@"Select.plist"];
[finalMutable writeToFile:rangePath atomically:YES];
[finalIndex writeToFile:indexPath atomically:YES];
}
mise à jour:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[finalIndex addObject:[NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section]];
}
Pls ajouter ce ne finalMutable et finalIndex contient, finalIndex doit être un problème –
Ils ont tous deux même, c'est NSLog: final Nombre de comptes: 5, nombre de finalIndex: 5 –