Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone - store NSTimeInterval on a coredata

I have an entry on a core data entity that represents a NSTimeInterval.

First question: How do I represent this entity on the dababase model? Double? Float?

Then, when I store it, is it fine to create an object like

[NSNumber numberWithFloat:myTimeInterval];

or

[NSNumber numberWithDouble:myTimeInterval];

or should I convert everything to string and store it like that?

thanks

like image 828
Duck Avatar asked Dec 24 '10 18:12

Duck


1 Answers

NSTimeInterval is a double. Store it with the latter line. There's no need to store it as an NSString.

like image 99
ZaBlanc Avatar answered Nov 08 '22 07:11

ZaBlanc