Aucune description

NSArray+Extra.m 589B

1234567891011121314151617181920212223242526
  1. //
  2. // NSArray+Extra.m
  3. // FirstLink
  4. //
  5. // Created by ascii on 16/5/16.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "NSArray+Extra.h"
  9. @implementation NSArray(Extras)
  10. - (NSString *)json {
  11. NSError *error;
  12. NSData *data = [NSJSONSerialization dataWithJSONObject:self
  13. options:NSJSONWritingPrettyPrinted
  14. error:&error];
  15. if (!error) {
  16. return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  17. }
  18. return nil;
  19. }
  20. @end