Dans le code suivant:NSMutableDictionary, alloc, init et reiniting
//anArray is a Array of Dictionary with 5 objs.
//here we init with the first
NSMutableDictionary *anMutableDict = [[NSMutableDictionary alloc] initWithDictionary:[anArray objectAtIndex:0]];
... use of anMutableDict ...
//then want to clear the MutableDict and assign the other dicts that was in the array of dicts
for (int i=1;i<5;i++) {
[anMutableDict removeAllObjects];
[anMutableDict initWithDictionary:[anArray objectAtIndex:i]];
}
Pourquoi cet accident? Comment est la bonne façon d'effacer un nsmutabledict et d'assigner un nouveau dict?
Merci gars.
Marcos.
Okay! C'est une bonne explication! –
@Marcos: Alors vous devriez * accepter * la réponse de @ Chuck. C'est la façon d'honorer les bonnes réponses à vos questions. –