ios之如何读取plist

- (NSDictionary*)contactsInfoFromPlistNamed:(NSString*)plistName {
    NSString *path = [[NSBundle mainBundle] pathForResource:plistName ofType:@"plist"];
    NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
    dictionary = [dictionary objectForKey:@"Root"];
    dictionary = [dictionary objectForKey:@"Contacts"];
    return [dictionary objectForKey:@"contactsInfo"];
}

  

你可能感兴趣的:(plist)