iphone sdk-预期的标识符错误
我正在尝试加载一个url,其中输入字段的值添加到url的末尾,并且该url错误为“expected identitifer”:(iphone sdk-预期的标识符错误,iphone,xcode,nsurl,Iphone,Xcode,Nsurl,我正在尝试加载一个url,其中输入字段的值添加到url的末尾,并且该url错误为“expected identitifer”:( 我做错了什么?你错过了括号 [self fetchURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[[urlField text]]]]]; 或者试试看 NSString *urlString = [NSS
我做错了什么?你错过了括号
[self fetchURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[[urlField text]]]]];
或者试试看
NSString *urlString = [NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[urlField text]];
NSURL *url = [NSURL URLWithString:urlString];
[self fetchURL:url];
根据以下内容编辑,现在出现错误:“发生连接故障。操作无法完成。连接被拒绝。”如果您仍然对此感到困扰,请将其作为单独的问题发布。
NSString *urlString = [NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[urlField text]];
NSURL *url = [NSURL URLWithString:urlString];
[self fetchURL:url];