Вопрос

I have a case where [[NSBundle mainBundle] infoDictionary] does only contain this:

17.09.11 18:28:26,936 [0x0-0x5a98a93].com.valvesoftware.steam: 2011-09-17 18:28:26.935 steam[85587:707] infodict: {
17.09.11 18:28:26,936 [0x0-0x5a98a93].com.valvesoftware.steam:     CFBundleExecutablePath = "/Applications/Spiele/Steam.app/Contents/MacOS/osx32/steam";
17.09.11 18:28:26,936 [0x0-0x5a98a93].com.valvesoftware.steam:     NSBundleInitialPath = "/Applications/Spiele/Steam.app/Contents/MacOS/osx32";
17.09.11 18:28:26,936 [0x0-0x5a98a93].com.valvesoftware.steam:     NSBundleResolvedPath = "/Applications/Spiele/Steam.app/Contents/MacOS/osx32";
17.09.11 18:28:26,936 [0x0-0x5a98a93].com.valvesoftware.steam: }

But I want to get the CFBundleIdentifier.

Is there another (more general) way to get the CFBundleIdentifier of the current process?

Это было полезно?

Решение

[[NSRunningApplication runningApplicationWithProcessIdentifier:getpid()] bundleIdentifier] works.

Другие советы

NSString *CFBundleIdentifier = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];


(CFBundleIdentifier = @"com.yourcompany.yourapp")
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top