Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the conventional way to manage custom property list keys in iPhone applications?

An [ApplicationName]-Info.plist file is created with every new iPhone SDK project. My question: is it conventional to add custom property keys to Info.plist and access them programmatically or should they be created in a separate plist?

Perhaps it doesn't much matter, but using the bundle descriptor plist for my custom attributes feels dirty.

[Note that I'm not asking about user-facing properties or settings, so I'm not referring to using a Settings bundle plist.]

like image 202
Justin Searls Avatar asked Aug 25 '09 21:08

Justin Searls


2 Answers

The Info.plist can contain any custom keys. See the docs:

You can include your keys in your bundle’s information property list file if you want all of your keys stored in one place.

I'm doing this for all my projects: I'm using a script to include the svnversion and build date/time in it to identify each build.

I'm using my own namespace (prefixing the keys) to avoid key name clashes.

like image 121
Nikolai Ruhe Avatar answered Oct 14 '22 01:10

Nikolai Ruhe


You add them to Info.plist and then access them programmatically.

Using the bundle descriptor plist for your custom attributes isn't dirty, it's almost universal.

like image 41
cdespinosa Avatar answered Oct 14 '22 01:10

cdespinosa