iphone - 在coredata上存储NSTimeInterval [英] iphone - store NSTimeInterval on a coredata
本文介绍了iphone - 在coredata上存储NSTimeInterval的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在核心数据实体上有一个表示NSTimeInterval的条目。
I have an entry on a core data entity that represents a NSTimeInterval.
第一个问题:我如何在dababase模型上表示这个实体?双?浮动?
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?
感谢
推荐答案
NSTimeInterval是双重的。存储它与后一行。没有必要将它存储为NSString。
NSTimeInterval is a double. Store it with the latter line. There's no need to store it as an NSString.
这篇关于iphone - 在coredata上存储NSTimeInterval的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文