Beginning-of-a-story
Results
1
comments of
Beginning-of-a-story
NSBundle *bundle = [NSBundle bundleForClass:[value class]]; if(bundle == [NSBundle mainBundle]){//自定义的类 return [self jsonStringWithArray:@[value]]; }else{//特殊类型 return [[NSKeyedArchiver archivedDataWithRootObject:value] base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; } 因为是用第三方给的静态库中的模型,不在mainBundle中。这里会被判断为特殊类型