小技巧

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"];

posted @ 2010-06-03 13:25  javawebsoa  Views(120)  Comments(0Edit  收藏  举报