我正在使用我编写的脚本自动将动态IP写入.txt文件,但问题是单击退出按钮时无法关闭对话框.
set yn to (display dialog "Your ip has been written to the server, the application will re-run in 10 minutes if you DO NOT close this window." buttons {"Quit", "Run again"} giving up after 600)
if yn is equal to "Quit" then
quit
end if
Run Code Online (Sandbox Code Playgroud) - (IBAction) createAccount: (id) sender {
NSString *post =[NSString stringWithFormat:@”name=%@&password=%@&email=%@”,nameField.text, passwordField.text, emailField.text];
NSString *hostStr = @”domain.tk/in-app/account/create-account.php?”;
hostStr = [hostStr stringByAppendingString:post];
NSData *dataURL = [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]];
NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];
if([serverOutput isEqualToString:@”Yes”]){
UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@”Congrats” message:@”Your account has bee succesfully created. “
delegate:self cancelButtonTitle:@”OK” otherButtonTitles:nil, nil];
[alertsuccess show];
[alertsuccess release];
} else {
UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@”Error” message:@”We are sorry, but an error has been encountered, please …Run Code Online (Sandbox Code Playgroud)