File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 **IMPORTANT:** The `^` block MUST return an object with a class that can be serialized by JSONKit, otherwise the serialization will fail.
3535
3636 <pre>
37- ​- (NSData \*)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(\^ )(id object))block error:(NSError \*\*)error;
38- ​- (NSString \*)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(\^ )(id object))block error:(NSError \*\*)error;
37+ ​- (NSData \*)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^ )(id object))block error:(NSError \*\*)error;
38+ ​- (NSString \*)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^ )(id object))block error:(NSError \*\*)error;
3939 </pre>
4040
4141 Example using the delegate way:
9090 [outputFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZZZ"];
9191 ​
9292 jsonString = [array JSONStringWithOptions:encodeOptions
93- serializeUnsupportedClassesUsingBlock:\^ id(id object) {
93+ serializeUnsupportedClassesUsingBlock:^ id(id object) {
9494 if([object isKindOfClass:[NSDate class]]) { return([outputFormatter stringFromDate:object]); }
9595 return(NULL);
9696 }
You can’t perform that action at this time.
0 commit comments