• 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: Updating application info plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating application info plist


  • Subject: Re: Updating application info plist
  • From: Mike Abdullah <email@hidden>
  • Date: Fri, 9 Oct 2009 12:08:30 +0100


On 9 Oct 2009, at 10:55, Zephyroth Akash wrote:

Hi,

I'm facing a weird issue.

I get the Info.plist of the app like this.
NSMutableDictionary *infoPlist = [[NSBundle mainbundle] infoDictionary];

Warning lights should be going off here. -infoDictionary is defined as returning an NSDictionary so there is no guarantee it will be mutable. At the very least do:


NSMutableDictionary *infoPlist = [[[NSBundle mainBundle] infoDictionary] mutableCopy];

But considering the documentation of -infoDictionary, I'd say this isn't a particularly good idea anyhow. As the docs say:

"The NSBundle class may add extra keys to this dictionary for its own use."

Instead, I think you're better off loading the plist manually yourself.


After the update of some resources I want to write the new version of these resources in the Info.plist.


No problem.


But when the app execute : [infoPlist writeToFile:pathToInfoPlistOfTheApp atomically:YES];


Nothing happens even if I change the path to my desktop, the dictionary is not written.

Are there some limitations ?
Can I write the Info.plist while the application is running ?

Zephyroth
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Updating application info plist (From: Zephyroth Akash <email@hidden>)

  • Prev by Date: Re: How to set checkbox state in TableView columnheader
  • Next by Date: Re: Instance variables: access directly vs. getter / setter
  • Previous by thread: Updating application info plist
  • Next by thread: Re: Updating application info plist
  • Index(es):
    • Date
    • Thread