Xcode Iphone SDK – Split String
Last time I had to split a string (after every 2 characters) in xcode. substringWithRange does the trick!
1 2 3 4 5 6 7 8 9 10
// Color code: #e213ff NSString *col = @"e213ff"; NSString *col1 = [col substringWithRange:NSMakeRange(0, 2)]; NSString *col2 = [col substringWithRange:NSMakeRange(2, 2)]; NSString *col3 = [col substringWithRange:NSMakeRange(4, 2)];