iphone - How to show an UIAlertView (Or UIView) at the first launch of an Application? -
i know how show uialertview or uiview @ first launch of application.
thanks.
use nsuserdefaults
store bool, so:
-(void) showfirstrunalerts { bool ranbefore = [[nsuserdefaults standarduserdefaults] boolforkey:@"ranbefore"]; if (!ranbefore) { uialertview *alert = [[uialertview alloc] initwithtitle:@"message title." message:@"your message." delegate:self cancelbuttontitle:@"thanks!" otherbuttontitles:nil]; [alert show]; [alert release]; [[nsuserdefaults standarduserdefaults] setbool:yes forkey:@"ranbefore"]; [[nsuserdefaults standarduserdefaults] synchronize]; } }
Comments
Post a Comment