0

Suppose a define like this

#define myDate [NSDate date]

every time I use it, it gives me the current date, what is ok.

What I want is to store the date the code was compiled. Can I do that with defines or using any other way?

I want the date to be hard stored in the code.

Ok I know I can store the date as string, this is not what I want.

Mickey
  • 3
  • 1

1 Answers1

3

GCC has predefined macros for this. Check out __DATE__ and __TIME__.

https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

Also, you can define your own key like CFBuildDate and increment it with a script : Xcode project's "Build number"

Community
  • 1
  • 1
Templar
  • 1,694
  • 1
  • 14
  • 32