views:

153

answers:

1

How would I set this method to display the alert panel 30 days from the initial launch of the application?

-(void)awakeFromNib

{

NSDate * today = [NSDate date];

NSTimeInterval expiry = ();


if ([today timeIntervalSinceReferenceDate] > expiry){
 NSRunAlertPanel(@"Trial period has ended", @"Please Register", nil, nil, nil);
 NSLog(@"expired");
 [[NSApplication sharedApplication] terminate:self];
}

}

thanks.

-paul

+3  A: 

You can find an open source implementation for a time trial class here: http://www.eternalstorms.at/developers/esstimetrialclass/index.html
Take a look at the startTimer method in that class.

weichsel