开发者

Help need to iterate through big JSON feed

I have a big JSON feed, which contains an array called Show, Place and Conserts.

Show looks like this:

"Id":"1", "ActivityType":"", "Name":"Some show", "Description":""

Place looks like this:

"Id":"4", "Name":"Some place", "Area": ""

Conserts looks like this:

"Show":"1", "Place":"4", "Start":"2011-08-11T19:00:00Z"

So basically for each show and place I need to iterate through and see when their ids ma开发者_如何转开发tch in Conserts. However, when I do this it takes about a minute to iterate through everything on the device. I've used NSMutableArray to do this. I store everything from the JSON feed into Core Data.

Does anyone have a suggestion for what I can do to reduce the time on the iteration through my NSMutableArrays containing the data from Core Data?


If it's stored in Core Data, you can pull out the just the entities you need using a predicate to filter the information.

More info can be found here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdFetching.html

I'd utilize the information under "Retrieving Specific Objects".

good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜