You should be using NSJSONSerialization +JSONObjectWithData:options:error:
to get the dictionary from your JSON data. It takes an options
parameter which you should be setting to NSJSONReadingMutableContainers
so that the created arrays and dictionaries from the JSON are all mutable.
Your current code is making self.imageDetails
a mutable dictionary (though none of its contents are likely to be mutable), but then you are trying to mutate self.detailData
. It isn't clear how these 2 are related but you should set up the mutability of the data structures when created (deserialised from the JSON).