• 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: No Subject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No Subject


  • Subject: Re: No Subject
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 5 Feb 2004 11:39:34 -0600

The object you have in the NSArray pointer deviceArray is an array of three NSArrays. The obvious thing to do, since you want the object at index 0 of deviceArray, is to use [deviceArray objectAtIndex: 0]. As in:
[objectPopUp addItemsWithTitles: [deviceArray objectAtIndex: 0]];

Did you try this?

-- F

On 4 Feb 2004, at 6:07 AM, email@hidden wrote:

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

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
<key>DeviceList</key>
<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>
_______________________________________________


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???
_______________________________________________
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: 
 >No Subject (From: email@hidden)

  • Prev by Date: Re: Unwanted retain
  • Next by Date: Background app, NSStatusItem, tight loop, event handling
  • Previous by thread: No Subject
  • Next by thread: No Subject
  • Index(es):
    • Date
    • Thread