加速器。属性文件的时间戳
钛金SDK版本:1.7.0 iPhone SDK 版本:4.2
我正在创建一个 iOS 应用程序,并使用属性文件作为缓存。 如何获取属性的创建时间(时间戳)?
感谢所有的投入!
Titanium SDK version: 1.7.0
iPhone SDK version: 4.2
I am creating an iOS app and I am using property files as cache.
How can I get the created time (timestamp) for a property?
Thankful for all input!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在我的应用程序中做了类似的事情。我使用时间戳与后端服务器同步数据,因此我编写了一个详细函数以便于访问:
然后
我所做的是将当前时间作为时间戳返回并除以 1000,这将返回 UNIX 时间戳,保持一致与我的后端系统。
将其添加到函数意味着它是可重用的,否则将其分配给变量会执行相同的操作,但该值将始终与初始化应用程序时的值相同。
I do something similar in my apps. I use a timestamp for syncing data with a backend server so I wrote a nitty-gritty function for easy access:
Then
so what I do is return the current time as a timestamp and devide by 1000, this returns a UNIX timestamp, keeping things consistent with my backend system.
Adding it to a function means it's reusable, otherwise assigning it to a variable will do the same thing but the value will always be the same as what it was when initializing the app.
在创建该属性的同时,我将创建一个带有时间戳字符串的姐妹属性。
例如:
据我所知,Property对象没有属性,每个键只有一个值。如果您打算多次执行此操作,我可能会创建一个匿名函数。
At the same time that the property is created, I would just create a sister property with a timestamp string.
For example:
As far as I know, the Property object has no properties, and only one value per key. I would probably create an anonymous function if you intend to do this more than a few times.