ios开发中pickerview加载plist文件之后显示的是问号这是为什么 ,求解答 5
-(void)viewDidLoad{[superviewDidLoad];NSBundle*bundle=[NSBundlemainBundle];NSURL*plst...
- (void)viewDidLoad {
[super viewDidLoad];
NSBundle *bundle = [NSBundle mainBundle];
NSURL *plstUrl = [bundle URLForResource:@"statedictionary" withExtension:@"plist"];
self.stateZips = [NSDictionary dictionaryWithContentsOfURL:plstUrl];
NSArray *allStates = [self.stateZips allKeys];
NSArray *sortedStates = [allStates sortedArrayUsingSelector:@selector(compare:)];
self.state = sortedStates;
NSString *selectedState = self.state[0];
self.zips = self.stateZips[selectedState];
} 展开
[super viewDidLoad];
NSBundle *bundle = [NSBundle mainBundle];
NSURL *plstUrl = [bundle URLForResource:@"statedictionary" withExtension:@"plist"];
self.stateZips = [NSDictionary dictionaryWithContentsOfURL:plstUrl];
NSArray *allStates = [self.stateZips allKeys];
NSArray *sortedStates = [allStates sortedArrayUsingSelector:@selector(compare:)];
self.state = sortedStates;
NSString *selectedState = self.state[0];
self.zips = self.stateZips[selectedState];
} 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏5(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询