/ Published in: Objective C

Using a gcc predefined macro, __DATE__, the code can know for itself when it was compiled, and build in an expiration date based on that value.
For a internationalised version see: http://snipplr.com/view/7196/kill-app-after-expire-date-suicidal-code-redux/
For a internationalised version see: http://snipplr.com/view/7196/kill-app-after-expire-date-suicidal-code-redux/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// For a internationalised version // see: http://snipplr.com/view/7196/kill-app-after-expire-date-suicidal-code-redux/ // Two-week expiration #define EXPIREAFTERDAYS 14 #if EXPIREAFTERDAYS // Idea from Brian Cooke. [nowDate addTimeInterval:(60*60*24* EXPIREAFTERDAYS)]; { // Run an alert or whatever // Quit! [NSApp terminate:self]; } #endif
URL: http://www.red-sweater.com/blog/371/suicidal-code
Comments
