在Objective-C for iPhone中解析Java Properties文件 [英] Parsing a Java Properties file in Objective-C for iPhone

查看:375
本文介绍了在Objective-C for iPhone中解析Java Properties文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 string with escape sequences \t \n \r \\ \" \' \ (space) \u0123
c = a string with a continuation line \
    continuation line
d.e.f = another string

将产生四个键/值对。

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

I can't change this format as it is sent to me by a web service. Can you please direct me?

谢谢,
Emmanuel

Thanks, Emmanuel

推荐答案

我会看看ParseKit http://parsekit.com/ 。否则你可以使用RegexKitLite并创建一些常规的表达式。

I would take a look at ParseKit http://parsekit.com/. Otherwise you could use RegexKitLite and create some regular expressions.

这篇关于在Objective-C for iPhone中解析Java Properties文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆