tags:

views:

50

answers:

3

Hi,

I have a lite and a full version and want them to work with different configuration Files.

Now I need to query, within the application, if the application name has "lite" in it and load the coresponding config-file I havent found how to do it. Any Idea ? Or is there generally a better approach for that ? Thanks in advance Heiko

A: 

You application has a main() in main.m (if you used a template). It gets passed the command-line arguments and argv[0] should be the full path of the application, which you can parse. You'll have to save it in a global variable.

You could also check the launchOptions in the appDelegate to see if it's there too.

Lou Franco
ahhh damn. I should have remembered this from a long ago c lesson :-)thanks alot
HeikoG
A: 

Try

[[NSProcessInfo processInfo] processName]

This returns process name, which is usually your application's name.

Akash Kava
+1  A: 

If you want what was put into the Info.plist file, use:

NSString * displayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
Dave DeLong