• 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: Equivalent to NSLocalizedStringFromTable() for working with a XML?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?


  • Subject: Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
  • From: Allan Odgaard <email@hidden>
  • Date: Mon, 13 Sep 2004 19:13:43 +0200

On 13. Sep 2004, at 14:40, George Lawrence Storm wrote:

My query is if there is a function/macro that already exists which will do what I need in a single call

None that I am aware of. I think you can get images, sounds, and nibs loaded in one go, but the rest of your localized resources you'll have to load yourself.


I guess arrayWithContentsOfFile: and dictionaryWithContentsOfFile: really ought to use pathForResource:ofType: when the path is relative! :)

I am asking prior to my writing one to do something similar for property list formatted resource(s) and end up doing something in a non-standard way (I don't want to reinvent the wheel for something that seems so basic).

Something like this should suffice: NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource:name ofType:@"plist"]];

Though it won't give you default values or fallback on other languages for individual keys, though I wonder if you really need this granularity?
--
http://macromates.com/ ::: TextMate, OS X text editor
http://macromates.com/sigpipe/ ::: Personal weblog about programming


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Equivalent to NSLocalizedStringFromTable() for working with a XML? (From: George Lawrence Storm <email@hidden>)
 >Re: Equivalent to NSLocalizedStringFromTable() for working with a XML? (From: Allan Odgaard <email@hidden>)
 >Re: Equivalent to NSLocalizedStringFromTable() for working with a XML? (From: George Lawrence Storm <email@hidden>)

  • Prev by Date: Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
  • Next by Date: Re: New ML List Software
  • Previous by thread: Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
  • Next by thread: persistentObjectForItem in NSOutlineView
  • Index(es):
    • Date
    • Thread