How-To: Convert NSData to NSString
How do you convert an NSData object into it’s string representation? Should be easy, right? It is, when you know how… NSString* theString = [[NSString alloc] initWithData:theData encoding:NSASCIIStringEncoding];
How do you convert an NSData object into it’s string representation? Should be easy, right? It is, when you know how… NSString* theString = [[NSString alloc] initWithData:theData encoding:NSASCIIStringEncoding];
If you need to convert a total number of seconds into specific components (days, hours, minutes and seconds) in Objective-C, you can use this code snippet. You can probably do this a million other ways, but this works beautifully for me: NSNumber *valueForDisplay = [NSNumber numberWithDouble: [self valueForDisplay:clockName]]; NSNumber *totalDays = [NSNumber numberWithDouble: [...]