• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Making a beta version expire
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making a beta version expire


  • Subject: Making a beta version expire
  • From: Ulai Beekam <email@hidden>
  • Date: Fri, 12 Mar 2010 04:03:27 +0000
  • Importance: Normal

For a beta version of an app, let's say I want to make sure that users cannot use the beta for far too long, far longer than the app goes out of beta. (Note that this case would in reality rarely occur. Most users would end up getting notified of a new update far sooner. This is just a "safety" measure.)

So this is how I thought of doing it. Let's say I want to make the app expire on January 1, 2011 (since I'm sure that I'll have a new beta release or go out of beta before then). What do you think about putting the following code in AppController's awakeFromNib?

-----------------------
NSDateComponents *comps = [[NSDateComponents alloc] init];
[comp setDay:1]; [comp setMonth:1]; [comp setYear:2011];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDate *expiryDate = [gregorian dateFromComponents:comps];

NSDate *now = [NSDate date];

if ([now compare:expiryDate] == NSOrderedDescending)
{
  NSRunAlertPanel(@"App Expired",@"Visit website",@"OK",nil,nil);
  [NSApp terminate:self];
  return;
}
-----------------------

Do you think this would work? I mean, it seems that it should, but one can never be sure. Plus, this might be a lousy method, compared to what some of you geniuses in here might have conjured up over the ages.

Thanks, U.




_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Making a beta version expire
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: NSTableView _dataSourceValueForColumn:row: failure
  • Next by Date: Re: NSTableView _dataSourceValueForColumn:row: failure
  • Previous by thread: Re: Use of KVC Array operators
  • Next by thread: Re: Making a beta version expire
  • Index(es):
    • Date
    • Thread