• 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
RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RETRIEVING AN ARRAY ENTRY FROM AN ARRAY


  • Subject: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
  • From: email@hidden
  • Date: Wed, 4 Feb 2004 07:04:14 EST

From test plist file
_______________________________________________

<key>DeviceList</key>
<array>
<string>XSKey1</string>
<string>XSKey2</string>
<string>XSKey3</string>
</array>
_______________________________________________

Code
_______________________________________________

[objectPopUp removeAllItems];
NSArray *deviceArray;
deviceArray = [[NSUserDefaults standardUserDefaults]objectForKey:
@"DeviceList"];
[objectPopUp addItemsWithTitles:deviceArray];
_______________________________________________

While this code does work with the array "DeviceList" if it has strings
stored in it as listed.

The problem is that each entry in this array is an array with 3 entries and I
only wish to retrieve the first (0) entry from each array.

Here is the actual plist file content
_______________________________________________
From plist file
_______________________________________________

<key>DeviceList</key>
<array>
<array>
<array>
<string>XSKey1</string>
<string>LPlat.dat</string>
<string>gvggz55l-a4l94772-uoc9sbg </string>
</array>
<array>
<string>XSKey2</string>
<string>LPro.dat</string>
<string>gvffz66l-a4l84662-uoc8sbg </string>
</array>
<array>
<string>XSKey3</string>
<string>LGold.dat</string>
<string>hkjjm44l-c2319491-ukg6van</string>
</array>
</array>
</array>
_______________________________________________


I've tried "arrayForKey" but it doesn't populate the menu and
"stringArrayForKey" doesn't seem to work either so I'm assuming that I should be using
arrayForKey and then extracting the data I require from it, any ideas for a
solution???

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

  • Prev by Date: Re: Changing the signature of the application
  • Next by Date: No Subject
  • Previous by thread: Re: Changing the signature of the application
  • Next by thread: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
  • Index(es):
    • Date
    • Thread