I have an iPhone application which gets a json string from a server and parses it. It contains some data e.g. school timetable information. The data is stored in an nsdictionary and then passed into a nsmuttablearray. e.g.
Could someone please point me in the right direction/tell me how i can access the different ‘roots’ of the array? I want to store the elements that have the field ‘Day’ as “Monday” (or maybe u can tell me how i can sort/do a search though them). Been spending quite some time trying to find some information on this (how to access/alter nested values) but no luck =/. thanks..
Your best bet for accessing all of the Dictionary objects with Day = Monday would be to use a Predicate with a Key Path to what you’re after…
You can make the predicate dynamic too.
where dayOfTheWeek might be an NSString that holds the current day of the week in a loop etc.
If you want to sort the array, you can do so using Sort Descriptors.