iphone sdk - expected identifier error
i'm trying to load up a url with the value of the input field added to the end of the url and it errors with "expected identitifer" :(
[self fetchURL:[NSURL URLWithString:[NSString stringWithFormat开发者_StackOverflow社区:@"http://localhost/test/script.php?name=%@&",[[urlField text]]]];
what have I done wrong?
You have missed the bracket
[self fetchURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[[urlField text]]]]];
OR try instead
NSString *urlString = [NSString stringWithFormat:@"http://localhost/test/script.php?name=%@&",[urlField text]];
NSURL *url = [NSURL URLWithString:urlString];
[self fetchURL:url];
精彩评论