-4
我有以下JSON文本如下。我想將它整合到我的應用程序中,並且能夠將它的一部分分配給要使用的變量。簡單,我知道,但我無法弄清楚如何去做。如何在我的應用程序中使用此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'上做一些搜索。 – rmaddy
請注意,如果您在Google上搜索「objective-c json」,您將獲得數十個示例。 –