Editing Info.plist possible programmatically?
Asked Answered
C

3

16

I have set my Facebook-AppId in the Info.plist. But I wish to edit it because its dynamic. How shall I do it programmatically?

Charis answered 10/10, 2012 at 10:32 Comment(2)
"the plist"? You mean Info.plist?Proximo
Yes.Right. I'v edited my query.Charis
C
15

Probably write in info.plist is not good idea and it doesn't work because you are trying to write the dictionary to a .plist file inside your App bundle, which is read only. Thus it would not work and also would have more rejection chances even if you get it done other way.

BTW why Info.Plist only? I mean why you can not have it in other way e.g nsuserdefaults or sql

Chinatown answered 10/10, 2012 at 11:25 Comment(1)
Jigar, I want to change URL types in info.plist runtime, will it possible as mentioned #54685206Undecided
P
8

You can't edit the Info.plist of your app. You don't have write access to that file (assuming you want to release this on the App Store).

Proximo answered 10/10, 2012 at 10:35 Comment(1)
@Undecided I don't think soProximo
A
2

The only way to write a plist file is to copy it from the bundle to the document folder of your app.

After that you can write. Here is a good tutorial but there are much more. Just google. http://ipgames.wordpress.com/tutorials/writeread-data-to-plist-file/

Agrippina answered 10/10, 2012 at 10:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.