• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
MutableDictionary not adding objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MutableDictionary not adding objects?


  • Subject: MutableDictionary not adding objects?
  • From: email@hidden
  • Date: Sun, 25 Jan 2004 16:16:17 -0800

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.

  • Follow-Ups:
    • Re: MutableDictionary not adding objects?
      • From: Jonathan Jackel <email@hidden>
    • Re: MutableDictionary not adding objects?
      • From: mmalcolm crawford <email@hidden>
    • Re: MutableDictionary not adding objects?
      • From: Stefan Pantke <email@hidden>
    • Re: MutableDictionary not adding objects?
      • From: Buddy Kurz <email@hidden>
  • Prev by Date: Re: Odd DO Problem...
  • Next by Date: Re: [APP IDEA] Desktop Background Scripting
  • Previous by thread: Re: Creating Binding Compatible Interface Objects
  • Next by thread: Re: MutableDictionary not adding objects?
  • Index(es):
    • Date
    • Thread