fork(2) download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3. #import <Foundation/Foundation.h>
  4.  
  5.  
  6. int main()
  7. {
  8. char something[] = "apple,typhoon\0ARM,v8\0";
  9. NSData *xdata = [NSData dataWithBytes:something length:sizeof(something)];
  10. size_t xlen = [xdata length];
  11. uint8_t xbytes[xlen];
  12. [xdata getBytes:xbytes];
  13. NSMutableArray* strings = [[NSMutableArray alloc] init];
  14. int arrayPointer = 0, i = 0;
  15. for(i = 0; i < xlen; ++i)
  16. {
  17.  
  18.  
  19. if(xbytes[i] < 32)
  20. {
  21. arrayPointer++;
  22. }
  23. else
  24. {
  25. if([strings count] < arrayPointer+1)
  26. {
  27. [strings addObject:[[NSMutableString alloc] init]];
  28. }
  29. [[strings objectAtIndex:arrayPointer] appendFormat:@"%c", xbytes[i]];
  30. }
  31.  
  32. }
  33. printf("%@", strings);
  34.  
  35. }
  36.  
Success #stdin #stdout #stderr 0.01s 128640KB
stdin
Standard input is empty
stdout
("apple,typhoon", "ARM,v8")
stderr
2017-10-28 11:11:56.386 prog[32262:32262] autorelease called without pool for object (0x233b900) of class NSDataMalloc in thread <NSThread: 0x2345880>{name = (null), num = 32262}
2017-10-28 11:11:56.387 prog[32262:32262] autorelease called without pool for object (0x243a440) of class GSMutableString in thread <NSThread: 0x2345880>{name = (null), num = 32262}
2017-10-28 11:11:56.387 prog[32262:32262] autorelease called without pool for object (0x23e5ea0) of class NSMutableDataMalloc in thread <NSThread: 0x2345880>{name = (null), num = 32262}
2017-10-28 11:11:56.387 prog[32262:32262] autorelease called without pool for object (0x242b1f0) of class GSAutoreleasedMemory in thread <NSThread: 0x2345880>{name = (null), num = 32262}