Ranking zdawalności WORD Dąbrowa Górnicza w 2012r.
// This code will work in iOS 2 and up
// (spoiler: you're not going to need anything below iOS 6).
// Tested in iOS 7
// In your app's UIApplicationDelegate:
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
(...)
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults boolForKey:@"termsAccepted"])
NSString *message =
@"Your message for visitors here";
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"Cookies"
message:message
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Close message", nil];
[alert show];
}
}
// Elsewhere in the file:
- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey:@"termsAccepted"];
[defaults synchronize];
}
Brak komentarzy:
Prześlij komentarz