// NSString以UIT-8编码读取states.txt
NSString* s = [NSString stringWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"states" ofType:@"txt"]
encoding:NSUTF8StringEncoding error:nil];
//s中字符串以回车符为分隔的,分隔后,存入数组states中
NSArray* states = [s componentsSeparatedByString:@"\n"];