我想获得blank fill
数组,但我得到的arrayB
是nil
。我该怎么做?
JSON:
{
result = {
blankfill = "[[1, [u'', u'', u'', u''], False, 0]]";
choice = "[[1599, [1], False, 2], [1598, [1], False, 5], [1596, [1], True, 4], [1594, [1], True, 2], [1593, [1], False, 2], [1592, [1], False, 2]]";
spendTime = 20;
};
retcode = 0;
subjectid = 1;
submittime = "2016-05-07T18:43:35.094";
}
代码:
NSString *jsonStringB = [responseObject[@"result"] objectForKey:@"blankfill"];
NSString *jsonSB = [jsonStringB stringByReplacingOccurrencesOfString:@"False" withString:@"false"];
NSString *jsonSBA = [jsonSB stringByReplacingOccurrencesOfString:@"True" withString:@"true"];
NSData *dataB = [jsonSBA dataUsingEncoding:NSUTF8StringEncoding];
NSArray *arrayB = [NSJSONSerialization JSONObjectWithData:dataB options:NSJSONReadingMutableContainers error:nil];
for (NSArray *arr in arrayB) {
TaskConditonModel *model = [[TaskConditonModel alloc] init];
[model initModelWithArray:arr];
[self.blankfillArray addObject:model];
}