小编Isa*_*ner的帖子

如何处理AppleScript对话框响应?

我正在使用我编写的脚本自动将动态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)

applescript

2
推荐指数
2
解决办法
1万
查看次数

为什么这段代码会给我错误:"程序中意外的@"?

- (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)

objective-c

1
推荐指数
1
解决办法
469
查看次数

标签 统计

applescript ×1

objective-c ×1