Reading JSON from a file (in the Documents folder) into an NSDictionary in iOS

So you have a JSON file stored in the user’s Documents directory in your iOS app, and now you want to read it. First, you get the URL to the file by getting the user’s NSDocumentDirectory, then you can append your filename to it. To get the data out, you can read with NSString and use NSJSONSerialization JSONObjectWithData:options:error:. Note that in the Gist NSJSONReadingMutableContainers is used to ensure the dictionary is an NSMutableDictionary instead of NSDictionary. (You can choose other options to make the dictionary immutable, or partially mutable.)