I'm new to Xcode and I'm creating a rather simple Mac App with Xcode that has a DatePicker which will save the selection to a Coredata model.
While in Interface Builder, under that DatePicker's attributes, I can set a minimum date, maximum date and default date to show. However, I would like the default date shown to be tagged to the current time so that my user does not need to choose the date value unless it is a back dated entry.
I opened up the .xib file and found the following code that can change the default date shown:
<object class="NSDate" key="NSContents">
<double key="NS.time">354974400</double>
</object>
The default date can be changed by altering the value within the double key="NS.time" and /double tags. And it also seems like this value is in the number of seconds since 1970.
I have tried:
NSDate *today = [NSDate date];
I understand that I'll still need to convert that to a double value that is in the number of seconds since 1970.
So the question is, how can I change the current date to a value that I can parse it in so that the default date shown will always be the current date?