请参阅相同的问题here
我只是在实际设备上测试时才遇到崩溃。模拟器工作正常。请帮忙
-(void)setFormatForAnswer:(NSDictionary*)answerDict withJsonString:(NSString*)json{
NSData *jsonDatanew = [NSJSONSerialization dataWithJSONObject: [answerDict copy] options:0 error:nil];
NSString *jsonnew = [[NSString alloc] initWithData:jsonDatanew encoding:NSUTF8StringEncoding];
answerTobeReplacedInDB = jsonnew;
NSDictionary *answersDict = @{@"answers_json":json};
parameters = @{@"survey_answer":answersDict};
[self submitSurveyAnswer]; }