Jump to content

2 posts in this topic

Recommended Posts

Posted (edited)

Hello, all.

I am trying to show a UIAlertView in the settings when the user toggles a switch on for the first time. It should only show up once and never again for that certain switch.

I did manage to implement this, however, the alert was too slow in showing up and sometimes it showed up like 2 minutes later.

I would like it to show up instantly.

 

part of test.mm:

 -(void)alert {

NSUserDefaults *validate = [NSUserDefaults standardUserDefaults];
    NSString *alreadyRun = @"already_run";
    if ([validate boolForKey:alreadyRun])  
    return;
    [validate setBool:YES forKey:alreadyRun];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test Title"
    message:@"Test Message" delegate:nil cancelButtonTitle:@"Close Test Pop-Up"
    otherButtonTitles:nil];
    [alert show];
    [alert release];
}
@end

part of test.plist:

<dict>
			<key>action</key>
			<string>alert</string>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>test.com</string>
			<key>key</key>
			<string>test1</string>
			<key>label</key>
			<string>Test Label</string>
		</dict>

thanks

Updated by Astronaut
Posted (edited)

well just found out tapping the cell that the switch is on invokes the UIAlert.

I would still like to know how to implement it when the user toggles it on.

 

i need this is for extra info on the switch. It will show an alert with more info on that certain switch.

Updated by Astronaut

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines