How to read data structure from .plist file into NSArray

后端 未结 8 852
故里飘歌
故里飘歌 2020-11-28 20:15

I was creating a data structure manually using the following:

NSDictionary* league1 = [[NSDictionary alloc] initWithObjectsAndKeys: @\"Barclays Premier Leagu         


        
8条回答
  •  青春惊慌失措
    2020-11-28 20:51

    This Code is working

    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"plist-name" ofType:@"plist"];
    NSDictionary *Dictionary= [[NSDictionary alloc]initWithContentsOfFile:plistPath];
    NSLog(@" current version CFBundleVersion = %@",[Dictionary valueForKey:@"CFBundleVersion"]);
    

提交回复
热议问题