【发布时间】:2015-01-05 04:36:06
【问题描述】:
我有以下 JSON 文本,如下所示。我想将它合并到我的应用程序中,并且能够将它的一部分分配给要使用的变量。很简单,我知道,但我不知道该怎么做。
[{"id":"1","category":"1","fact":"Worldwide, around 1.2 trillion eggs are produced for eating every year, which means that average person on Earth consumes 173 eggs a year."},{"id":"3","category":"2","fact":"How to tell if you're going to throw up? -Your mouth starts to fill with saliva which is there to protect your mouth and teeth from the stomach acid mixed with the vomit."},{"id":"2","category":"2","fact":"Bone cells are constantly renew so every ten years you have a new skeleton."}]
【问题讨论】:
-
在
NSJSONSerialization上做一些搜索。 -
请注意,如果您在 Google 上搜索“objective-c json”,您会得到几十个示例。
标签: objective-c json