简体   繁体   English

来自NSString中plist文件的字符串

[英]String from plist file in NSString

I'm new in iPhone SDK. 我是iPhone SDK的新手。 Now i'm working with plist file witch content strings. 现在,我正在使用plist文件中的内容字符串。 How can I set a value of the first element in the file with type 'plist' to NSString variable? 如何将类型为'plist'的文件中第一个元素的值设置为NSString变量? I have plist content in NSArray : 我在NSArray有plist内容:

NSString *countriesList = [[NSBundle mainBundle] pathForResource:@"Countries" ofType:@"plist"];
countries = [[NSArray alloc] initWithContentsOfFile:countriesList];
NSString *countryName = [countries objectAtIndex:0];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM