English 中文(简体)
内容 heavy-清单或XML的数据格式
原标题:Data format for content heavy iPhone app - Plist or XML?

I m Building an Müller, which is fundamental a book, it will be bunded with a Much of text-heavy content.

我将数据捆绑在XML中,并在申请开始时装上XML,但XML将包含许多nes的结构,并且是痛苦的bit脚石。

最好使用一个清单吗? 我对记忆使用和清单完全被装上记忆——能否用chu子 par? 是否有一个名单最高,其效率如何?

我不敢肯定,捆绑的成分将如何大到,但我应该想象,它可能从500克到4MB。

最佳回答

财产清单是从NSObject获得的任何物品的本土序列化格式。 有一些保持 mu状态的问题,但总体清单是肥料首选的形式。 现有的一些平级方法,NSData可以提取标记细节。 至于XML,你重新承担撰写自己教区的任务。

详情请参见rel=“nofollow noreferer”>。

应当指出的是,一份清单本身是严格的XML;在选择清单时,在服务器上,你应当能够将清单XML加以分类,并将每两条标子作为关键值的鞋子处理。

问题回答

在我的经验中,从长远来看,名单对于你来说非常容易维持和更好。 我有类似的情况,并写了一份数据文档的投稿。 我的读本是使用所有相同的、没有额外设置的变体。 它击中了地面(只要你重新熟悉可可)。

Its even human readable with the property List Editor app included in the iPhone SDK. Although I don t recommend it for very large data structures by hand, that s why I mentioned how I built another app for that — the code generating the data and using it almost has a 1:1 comparison, they re that similar. The plist editor does come in very handy to tweak an item or edit small-medium data and, once again, it hides the underlying XML.

如果人类可读性是一个设计目标,那么你就应考虑智者。 它不是每项申请的正确答案,而是值得考虑。 The open-source json-framework (here: http://code.google.com/p/json-framework/) is GREAT,并为编码和编码JSON strings至物体提供了非常方便的方法,作为NSString的一个类别。 因此,你可以说:

NSString *jsonString = ...// however you re loading the goods
NSDictionary *myData = [jsonString JSONValue];

......繁荣,你与本地物体重新合作。 就我的钱来说,这比阅读清单更加容易。

为什么不把内容作为超文本处理? (5月分成几章或部分)

这样,你就可以在没有任何教义或改观的情况下,通过网上意见立即展示。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签