Skip to content

Instantly share code, notes, and snippets.

@hyukhur
Created February 15, 2013 07:49
Show Gist options
  • Save hyukhur/4959036 to your computer and use it in GitHub Desktop.
Save hyukhur/4959036 to your computer and use it in GitHub Desktop.
NSDictionary(NSArray) to Plist
NSArray *sDirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *sPath = [[sDirs objectAtIndex:0] stringByAppendingPathComponent:@"timeZoneMap.plist"];
NSDictionary *sZone = [(id)[NSLocale class] performSelector:@selector(ISOCountryCodesToTimeZoneMap)];
NSData *sTmp = [NSPropertyListSerialization dataWithPropertyList:sZone format:NSPropertyListBinaryFormat_v1_0 options:kCFPropertyListImmutable error:nil];
[sTmp writeToFile:sPath atomically:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment