Q: How can I split HH:MM:SS into NSArray using componentsSeparatedByCharactersInSet Like this NSString @"2013-09-02 0:00:00 +0800" I can split it into NSArray using componentsSeparatedByCharactersInSet method. 
The Array looks like this 
@["2013-09-02", "0:00:00", "+0800"].

But how can I split NSString @"0:00:00" into NSArray looks like 
@[@"0", "00", "00"]
 in Objective-C using `
componentsSeparatedByCharactersInSet method?

A: NSString *originalValue =  @"2013-09-02 0:00:00 +0800";

// First seperated by white space
NSArray *spaceSeperated= [string componentsSeparatedByString:@" "]; // result would be @[@"2013-09-02", @"0:00:00", @"+0800"]

// now for time string seperate that one by :
NSArray *timeSeperated = [[spaceSeperated objectAtIndex:1] componentsSeparatedByString:@":"]; 

Now, timeSeperate array will contains time value in 3 separate objects: @[@"0" , @"00" , @"00"]

A: If you want to know the hours, minutes and seconds of a date you should probably use NSDateFormatter first and then extract these properties with NSDateComponents.
NSString *yourString = @"2013-09-02 0:00:00 +0800";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"dd.MM.yyyy HH:mm:ss ZZZZ"];
NSDate *date = [dateFormatter dateFromString:yourString];

NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar components:NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:date];
NSInteger hour = components.hour;
NSInteger minute = components.minute;
NSInteger second = components.second;

//Alternative (NSArray can only contain objects - NSNumber vs. NSInteger)
NSArray *yourArray = @[[NSNumber numberWithInteger:components.hour],
                       [NSNumber numberWithInteger:components.minute],
                       [NSNumber numberWithInteger:components.second]];`

It might seem like more code but it is the cleaner solution. And remember NSDateFormatter is relatively expensive to create. If you can do it you should create it outside of a loop (it is not thread safe though);  

A: NSArray *arr = [string componentsSeparatedByString:@":"];


A: you have to use componentsSeparatedByString:@":" method.
