How to read data structure from .plist file into NSArray

后端 未结 8 833
故里飘歌
故里飘歌 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:50

    I had this issue but it wasn't working because I was putting the results from the pList into an array where it should have been a dictionary, i.e

    NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"VehicleDetailItems" ofType:@"plist"];
    NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
    

提交回复
热议问题