I'm calling a block and I need convert the error (which returns a JSON) into NSDictionary.
CODE:
[endPoint updateModel:self.model withDomain:A_DOMAIN successBlock:^{
} errorBlock:^(NSError *error) {
NSLog (@"Logging Error: %@", error);
}];
LOG:
2013-12-17 12:50:43.190 testApp[79103:70b]Logging Error: [Line 27] response string - [{"value":"sdfdsfewr","validator":"pattern","property":"profile.location.zip","expected":null,"message":"not a valid format ZIP code"}]
I would like to convert the *error that's into a NSDictionary? Thanks
the log from the "error" object does not look like an NSError object, but instead looks like some sort of dictionary. maybe its a JSON filled NSString? In that case you will need to use NSJSONSerialization as described here to turn it into an NSDictionary:
NSJSONSerialization from NSString