Blog > iphone

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)];

By Niels Musschoot
February 4, 2011, 5:57pm
Categories
Xcode Iphone SDK

Xcode Iphone SDK – Use Variable for UIButton setTitle


Fatal error: Cannot redeclare class Highlighter_Xml in /home/niels/domains/nielsmusschoot.com/public_html/wp-content/plugins/fv-code-highlighter/Includes/Highlighter/Xml.php on line 63