• 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
Re: Enumerating problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enumerating problems


  • Subject: Re: Enumerating problems
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Sat, 4 Oct 2003 15:52:44 +0100

On Saturday, October 4, 2003, at 03:26 pm, David Dauer wrote:

I load the array
defaults = [NSUserDefaults standardUserDefaults];
MyArray = [[defaults objectForKey:@"key"] retain];

Now I want to create NSMenuItems with the titles "1" and "3" and so on.
My problem is that I don't know how to enumerate through an array containing
dictionarys and getting everytime a value from the dictionary.

How about something like

NSEnumerator *dictEnum = [myArray objectEnumerator];
NSDictionary *dictionary;

while ((dictionary = (NSDictionary *) [dictEnum nextObject])) {
/* Work with dictionary here */
}

Kind regards,

Alastair.
_______________________________________________
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.

References: 
 >Enumerating problems (From: David Dauer <email@hidden>)

  • Prev by Date: adding byte by byte to a NSMutableData object
  • Next by Date: Re: Enumerating problems
  • Previous by thread: Enumerating problems
  • Next by thread: Re: Enumerating problems
  • Index(es):
    • Date
    • Thread