开发者

Weird problem due to changing system clock

I'm coding an app heavily based on dates and for debugging purposes related to leap years I was changing my system clock开发者_运维百科 back and forth between some dates. After setting my system date to February 13 2012 and back I am not able to interact with my Core Data objects.

I have tried deleting the application several times (from the simulator), building, and rebuilding but nothing seems to work. I can't add new objects to the database (and couldn't retrieve them when I still had a populated database).

Any other changes I make not related to Core Data seem to show up correctly. I also did a reset to the simulator but it didn't solve the problem.

Any idea what's wrong?


First, I have a general recommendation regarding clock testing:

Use a virtual machine when doing testing against different clock settings. This way, when you screw up the system you won't be screwing up your actual development system. You can easily revert a VM back to a known working state.

Having said that, your immediate problem may be that some file has been created with a timestamp far in the future, which is causing something else not to happen because of the incorrect timestamp. If the problem is indeed a file, you may be able to search your disk for a file dated in the future. If the timestamp is instead stored internally somewhere, then you may be in for some more reinstalling.


I had forgotten about deleting the build directory inside the project folder. Kind of silly I forgot about something like that.

I marked Greg's answer as correct because it is related to what he mentioned about timestamps. I searched my system for files created in the future and there they were in the build folder!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜