• 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:36:13 EST

Had an error, corrected and resubmitted.

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 (corrected due to error in pasting)
_______________________________________________

<key>DeviceList</key>
<array>
<array>
<string>XSKey1</string>
<string>XSKey1.dat</string>
<string>gvggz55l-a4l94772-uoc9sbg</string>
</array>
<array>
<string>XSKey2</string>
<string>XSKey2.dat</string>
<string>gvffz66l-a4l84662-uoc8sbg</string>
</array>
<array>
<string>XSKey3</string>
<string>XSKey3.dat</string>
<string>hkjjm44l-c2319491-ukg6van</string>
</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 doing
something else but not sure what, 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.

  • Follow-Ups:
    • Re: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: No Subject
  • Next by Date: Re: Newbie thread question (Randall Meadows)
  • Previous by thread: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
  • Next by thread: Re: RETRIEVING AN ARRAY ENTRY FROM AN ARRAY
  • Index(es):
    • Date
    • Thread