NSString *path = [[NSBundle mainBundle] pathForResource:
@"Eur" ofType:@"plist"];
NSString *path1 = [[NSBundle mainBundle] pathForResource:
@"Asia" ofType:@"plist"];
stationDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
我需要在stationDictionary中添加两个plist:1 Eur 2 Asia。但我不知道如何从第二个plist添加信息?
谢谢!
答案 0 :(得分:1)
NSString *path = [[NSBundle mainBundle] pathForResource:
@"Eur" ofType:@"plist"];
NSString *path1 = [[NSBundle mainBundle] pathForResource:
@"Asia" ofType:@"plist"];
NSMutableDictionary* stationDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
NSDictionary* dicForPath1 = [[NSDictionary alloc] initWithContentsOfFile:path1];
[stationDictionary addEntriesFromDictionary:dicForPath1];