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?
-
"*the* plist"? You mean Info.plist? – DrummerB Oct 10 '12 at 10:33
-
Yes.Right. I'v edited my query. – Ambili B Menon Oct 10 '12 at 10:34
4 Answers
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

- 6,004
- 2
- 27
- 45
-
1Jigar, I want to change URL types in info.plist runtime, will it possible as mentioned https://stackoverflow.com/questions/54684706/will-apple-reject-my-app-if-i-edit-my-info-plist-runtime?noredirect=1#comment96158315_54684706 – Aleem Feb 14 '19 at 07:24
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).

- 39,814
- 12
- 105
- 142
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/

- 2,607
- 3
- 31
- 55
As per the accepted answer, it's not a good idea to edit Info.plist, plus it's read-only file. High chances it will get blocked by App Store.
But Hitting (Saving the file) Ctr + S helped.
Try other option like SQL

- 566
- 5
- 6
-
This is the same solution as in [the accepted answer](https://stackoverflow.com/a/12818184/2227743). – Eric Aya Mar 23 '23 at 08:35