NSMutableArray *array = [[NSMutableArray alloc] init]; int len=0; while( (len+100)<[string length]) { [array addObject:[string substringWithRange:NSMakeRange(len,100)]]; len+=100; } [array addObject:[string substringFromIndex:len]];
Remember to free the array when you do this.
source share