, NTP:
https://github.com/jbenet/ios-ntp
, [NSDate networkDate];
appDelegate. - iPhone iPad:
if ([[NSDate networkDate] compare:startDate] == NSOrderedAscending) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Beta Not Started" message:@"Beta starts [[STARTDATE]]." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
return NO;
} else if ([[NSDate networkDate] compare:endDate] == NSOrderedDescending) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Beta Ended" message:@"Beta ended [[ENDDATE]]." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
return NO;
}
Then in your UIAlertViewDelegate:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
exit(0);
}
Hope this helps!
source
share