Convert HH:MM:SS to seconds in xcode
<p>Hi I have the code to separate hour,min,sec
Now i have to convert it in to seconds.and nsnumber</p>

<pre><code>    NSRange range = [string rangeOfString:@":"];
    NSString *hour = [string substringToIndex:range.location];
    NSLog(@"time %@",hour);

    NSRange range1= NSMakeRange(2,2);
    NSString *min = [string substringWithRange:range1];
    NSLog(@"time %@",min);
    NSRange range2 = NSMakeRange(5,2);
    NSString *sec = [string substringWithRange:range2];
    NSLog(@"time %@",sec);
</code></pre>
