Pages

Wednesday, February 1, 2012

[Code Snippet] Read application bundle identificator from plist.

Hi mates!!

A lot of work, so as usually we have not time to update the blog as we want, but today's we've get 5 free minutes to post a new code snippet.

I know, because I just tried to do it, that most of you have tried to read application bundle Id from the plist asi usual, getting the path to the plist file, obtaining its values and getting the correct key.

There's a shorter way to accomplish that, just using NSBundle infoDictionary property that returns us the values stored in our Project-Info.plist.


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

I hope this will be useful for everyone, but now I may continue developing. Turning back to my XCode!

Regards!