• 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
adding an additional plist files as resources? possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding an additional plist files as resources? possible?


  • Subject: adding an additional plist files as resources? possible?
  • From: Ken Hawkins <email@hidden>
  • Date: Mon, 27 Sep 2004 17:29:12 -0700

let me explain a bit. i have an xml doc (subjects.plist)....

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BJSubjectTypes</key>
<dict>
<key>Animals</key>
<array>
<string>Aliens</string>
<string>Birds</string>
<string>Cats, Kittens</string>
<string>Cows</string>
<string>Dinosaurs</string>
<string>Dogs</string>
<string>Farm Animals</string>
<string>Fish</string>
<string>Horses</string>
<string>Insects</string>
<string>Rabbits</string>
<string>General</string>
<string>Pets</string>
<string>Puppies</string>
<string>Reptiles</string>
<string>Snakes</string>
<string>Wild Animals</string>
</array>
...
</dict>
</dict>
</plist>

and was wondering how to access it from code similar to:

NSDictionary * infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSDictionary * genres = [[NSDictionary alloc] init];


// If we succeeded, look for our property.
if ( infoDictionary != NULL ) {


NSDictionary * genres = [infoDictionary objectForKey:@"CFGenreTypes"];


//NSLog([genres description]);
}


the above loads an entry that i have in place already for genre types which are formatted similar to the above subjects.plist. is it even possible?

the kicker is that if i have to go and add each subject and array within xcode's expert view of the plist entries this could take a while. is there an easier way to load and access a plist? i can add it as a resource but am not sure how i would load and make use of it. can i do this at all? it seems that you could given that you can type in one at a time and keys in the expert view yet i am a bit stumped.

any help? am i making sense or barking up the wrong tree?

thanks,
ken;
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: adding an additional plist files as resources? possible?
      • From: Ken Hawkins <email@hidden>
  • Prev by Date: Re: NSString weirdness [FIXED]
  • Next by Date: Re: adding an additional plist files as resources? possible?
  • Previous by thread: How to change name of a nib file?
  • Next by thread: Re: adding an additional plist files as resources? possible?
  • Index(es):
    • Date
    • Thread