开发者

iphone sdk - expected identifier error

开发者 https://www.devze.com 2023-03-24 05:21 出处:网络
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\" :(

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消