我有一个 plist,我想在 uipickerview 中获取其内容。
我可以使用以下命令在控制台中输出 plist 的内容:
// Path to the plist (in the application bundle)
NSString *path = [[NSBundle mainBundle] pathForResource:
@"loa" ofType:@"plist"];
// Build the array from the plist
NSMutableArray *array2 = [[NSMutableArray alloc] initWithContentsOfFile:path];
// Show the string values
for (NSString *str in array2)
NSLog(@"--%@", str);
我需要弄清楚的是如何将这些内容放入 UIPickerView。
我尝试了以下方法:
arrayPicker = [[NSMutableArray alloc] initWithArray:array2];
,但得到一个错误:exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance
谢谢你的帮助