JSON encoding error for super long messages
This commit is contained in:
@@ -12,8 +12,10 @@
|
||||
|
||||
+ (instancetype)responseWithJSONObject:(id)object
|
||||
{
|
||||
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
|
||||
NSError *error = nil;
|
||||
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error];
|
||||
if (data == nil) {
|
||||
NSLog(@"JSON encoding error: %@", error);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user