// 创建json串
- (NSString *)createJsonString {
NSString *jsonString = @"";
NSDictionary *dict = @{
@"voiceurl":_voiceurl,
@"message":_message,
@"username":_username,
@"photo":_photo,
@"time":_time,
@"userid":[NSNumber numberWithInteger:_userid],
@"messagetype":[NSNumber numberWithInteger:_messagetype],
@"voicetime":[NSNumber numberWithInteger:_voicetime],
@"isread":[NSNumber numberWithInteger:_isread],
};
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil];
jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
return jsonString;
}