我正在尝试加载一个网址,其中输入字段的值已添加到网址的末尾,并且错误地显示为“预期的识别符号”:(
[self fetchURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[[urlField text]]]];
我做错了什么?
答案 0 :(得分:0)
你错过了支架
[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];