小技巧

1。当前机器语言

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];

NSArray* languages = [defs objectForKey:@"AppleLanguages"];

NSLog(@"%@",languages);

NSString* preferredLang = [languages objectAtIndex:0];

NSLog(@"%@",preferredLang);

2。使用bunlde

NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"myBundle.bundle/image.png"];

你可能感兴趣的:(小技巧)