Create an NSDictionary from a PList : Rex St John
Here is a simple category for rapidly converting a PList into an NSDictionary, very useful.
Originally published at rexstjohn.com on April 22, 2013. Recovered from the Internet Archive.
Here is a simple category for rapidly converting a PList into an NSDictionary, very useful.
#import "NSDictionary+PList.h"
@implementation NSDictionary (PList)
+(NSDictionary*)dictionaryFromPlistWithName:(NSString*)plistName{
// Path to the plist (in the application bundle)
NSString *path = [[NSBundle mainBundle] pathForResource:
plistName ofType:@"plist"];
return [[NSDictionary alloc] initWithContentsOfFile:path];
}
@end