Parsing a Java Properties file in Objective-C for iPhone

后端 未结 6 909
情话喂你
情话喂你 2021-01-18 19:09

I\'m looking for a way in the iPhone SDK to read in a Properties file (not the XML flavor) for example this one:

# a comment
! a comment

a = a string
b = a          


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-18 19:34

    Take a look at this PropertyParser

    NSString *text = @"sample key = sample value";
    
    PropertyParser *propertyParser = [[PropertyParser alloc] init];
    
    NSMutableDictionary *keyValueMap = [propertyParser parse:text];
    

提交回复
热议问题