Ma question est pourquoi il sort les 4 dernières lignes dans le journal (voir ci-dessous) ... ces objets font partie du dictionnaire imprimé plus tôt dans le journal & ne devrait pas être situé à la fin du tableau? Il me manque quelque chose de fondamental ici ... thxEnumerating tableau qui contient un dictionnaire produit une sortie inattendue
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSURL URLWithString: @"www.stanford.edu"],
@"Stanford University",
[NSURL URLWithString: @"www.apple.com"],
@"Apple shop",
[NSURL URLWithString: @"cs193p.stanford.edu"],
@"CS193P course",
[NSURL URLWithString: @"itunes.stanford.edu"],
@"Stanford on iTunes U",
[NSURL URLWithString: @"stanfordshop.com"],
@"Stanford Mall",
nil];
NSMutableArray *myArray = [NSMutableArray arrayWithObjects:
[NSString init],
[NSURL URLWithString: @"www.stanford.edu"],
[NSProcessInfo processInfo],
dictionary,
[@"Mutable string example" mutableCopy],
[@"another mutable string" mutableCopy]];
NSEnumerator *enumerator = [myArray objectEnumerator];
id object;
while ((object = [enumerator nextObject])) {
NSLog([object description]);
}
2009-07-02 09: 35: 12,756 WhatATool [6407: 10b] NSString
2009-07-02 09: 35: 12,756 WhatATool [6407: 10b] www.stanford.edu
2009-07-02 09: 35: 12,757 WhatATool [6407: 10b] <NSProcessInfo: 0x107e20
>
2009-07-02 09: 35: 12,758 WhatATool [6407: 10b] {
« Apple boutique "= www.apple.com;
"Cours CS193P" = cs193p.stanford.edu;
"Stanford Mall" = stanfordshop.com;
"Université Stanford" = www.stanford.edu;
"Stanford sur iTunes U" = itunes.stanford.edu;
}
2009-07-02 09: 35: 12,758 WhatATool [6407: 10b] exemple de chaîne Mutable
2009-07-02 09: 35: 12,759 WhatATool [6407: 10b] une autre chaîne mutable
2009-07 -02 09: 35: 12.760 WhatATool [6407: 10b] itunes.stanford.edu
2009-07-02 09: 35: 12.760 WhatATool [6407: 10b] Stanford sur iTunes U
2009-07-02 09:35 : 12,761 WhatATool [6407: 10b] stanfordshop.com
2009-07-02 09: 35: 12,762 WhatATool [6407: 10b] Stanford Mall
merci tas, sauvez-moi un peu de frustration - facile à manquer –