在Objective-C for iPhone中解析Java Properties文件

Emm*_*uel 5 objective-c ios4

我正在寻找iPhone SDK中的一种方式来读取属性文件(而不是XML风格),例如:

# a comment
! a comment

a = a string
b = a string with escape sequences \t \n \r \\ \" \' \ (space) \u0123
c = a string with a continuation line \
    continuation line
d.e.f = another string
Run Code Online (Sandbox Code Playgroud)

会导致四个键/值对.

我无法更改此格式,因为它是由Web服务发送给我的.你能指点我吗?

谢谢,伊曼纽尔

Mic*_*ick 3

我会看一下 ParseKit http://parsekit.com/。否则,您可以使用 RegexKitLite 并创建一些正则表达式。