When trying to get current date I get compile date instead

This is probably a very basic question but it’s stumped me and I can’t find the answer anywhere else. I have a text field in a window that’s supposed to show the current date every time the app is run. The key lines of code are these:


...
property todaysDate : (date string of (current date))
...
on applicationWillFinishLaunching_(aNotification)
	dateField's setStringValue_(todaysDate)
...

It’s correct on the day I compile it, but when I open the app on a later date, it keeps showing the original compile date. It never updates it unless I recompile.

What am I missing?

(In case it’s relevant, I’m doing this in an older version of Xcode: 3.2.6 )

Hi,

the value of the property is set at compile time and persists.
Set the value in the applicationWillFinishLaunching_ handler


...
on applicationWillFinishLaunching_(aNotification)
   dateField's setStringValue_((date string of (current date)))
...

or


...
property todaysDate : missing value
...
on applicationWillFinishLaunching_(aNotification)
   set todaysDate to (date string of (current date))
   dateField's setStringValue_(todaysDate)
...


Yeah, I guess I had been thinking of Property declarations as being simply variable declarations that ran with the program every time it started. I have a ton to learn.

Thanks! This helps a lot.