git-subtree-dir: server git-subtree-mainline:6a4054c15agit-subtree-split:800090542d
27 lines
647 B
Objective-C
27 lines
647 B
Objective-C
//
|
|
// MBIMJSONDataResponse.m
|
|
// kordophoned
|
|
//
|
|
// Created by James Magahern on 11/16/18.
|
|
// Copyright © 2018 James Magahern. All rights reserved.
|
|
//
|
|
|
|
#import "MBIMJSONDataResponse.h"
|
|
|
|
@implementation MBIMJSONDataResponse
|
|
|
|
+ (instancetype)responseWithJSONObject:(id)object
|
|
{
|
|
NSError *error = nil;
|
|
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error];
|
|
if (data == nil) {
|
|
NSLog(@"JSON encoding error: %@", error);
|
|
return nil;
|
|
}
|
|
|
|
MBIMJSONDataResponse *response = [[self alloc] initWithData:data contentType:@"application/json; charset=utf-8"];
|
|
return response;
|
|
}
|
|
|
|
@end
|