• 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: reading a plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading a plist


  • Subject: Re: reading a plist
  • From: Thomas Harrington <email@hidden>
  • Date: Sat, 20 Jul 2002 22:35:23 -0600

On Saturday, July 20, 2002, at 08:10 PM, Koen van der Drift wrote:

If I use the code example from Hillegass' book:

path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist"];

myList = [NSDictionary dictionaryWithContentsOfFile: path];
myArray = [myList objectForKey:@"testkeys"];
NSLog(@"test = %@", myArray);

Then I get all keys and values. If I use myArray = [myList
objectForKey:@"KeyA2"] then myList is null.

What kind of object is myArray? If an NSArray (as its name implies), you'll get incorrect results, because the plist you posted doesn't contain any arrays.
_______________________________________________
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: 
 >reading a plist (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Trying to print an nsimage... What am I doing wrong?
  • Next by Date: Re: reading a plist
  • Previous by thread: reading a plist
  • Next by thread: Re: reading a plist
  • Index(es):
    • Date
    • Thread