Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将时间戳设置为 nsuserdefaults 然后检查,如果它改变了,然后采取行动?
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"timestamp"]) { }
您不能将时间戳本身存储在 NSUserDefaults 中,但您可以存储一个表示 TimeStamp 的整数,您可以轻松比较这些。
以这个为例; 时间戳示例 - int 转换,存储在 NSUserDefaults 中