Re: MutableDictionary not adding objects?
Re: MutableDictionary not adding objects?
- Subject: Re: MutableDictionary not adding objects?
- From: Stefan Pantke <email@hidden>
- Date: Mon, 26 Jan 2004 01:56:45 +0100
Did you tried to
- (NSString *)description
for the suspect Dict? What does it print?
Moreover, if the two last if cases appear at the very
end of execution of the enumeration, you Dict will be
empty, since you call
[tempDict removeAllObjects];
Am 26.01.2004 um 01:16 schrieb email@hidden:
ok so i have this code to cycle through an array check the values add
them to other dictionaries and arrays then output it to a file the
problem is the tempDict's being added are empty when i open the xml
file output? does anything look wrong with this code?
NSEnumerator *e = [fieldsArray objectEnumerator];
id object;
NSMutableDictionary *tempDict = [NSMutableDictionary dictionary];
NSMutableArray *tempArray = [NSMutableArray array];
while(object = [e nextObject])
{
if ([object isEqualToString:@":"])
{
[ABCMenusArray addObject:tempArray];
[tempArray removeAllObjects];
}
else if ([object isEqualToString:@"sep"])
{
[tempDict setObject:@"sep" forKey:@"sep"];
[tempArray addObject:tempDict];
[tempDict removeAllObjects];
}
else
{
[tempDict setObject:object forKey:@"item"];
[tempDict setObject:[NSNumber numberWithBool:NO]
forKey:@"statsus"];
[tempArray addObject:tempDict];
[tempDict removeAllObjects];
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.