Read binary plist into NSDictionary

前端 未结 2 558
刺人心
刺人心 2020-12-20 00:04

Is there simple way to parse the binary plist file into the NSDictionary representation? I am searching something like that:

NSString* strings = [NSString st         


        
相关标签:
2条回答
  • 2020-12-20 00:44

    Considering a file called DataStorageFile.plist, you can use:

    NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"DataStorageFile" ofType:@"plist"];
    self.data = [NSDictionary dictionaryWithContentsOfFile:dataPath];
    

    If you want an array:

    self.data = [NSArray arrayWithContentsOfFile:dataPath];
    
    0 讨论(0)
  • 2020-12-20 00:49

    Are you looking for [NSDictionary dictionaryWithContentsOfFile:]?

    0 讨论(0)
提交回复
热议问题