2014-11-01 62 views
0

我有這個URL我想通過Self.Id在這個網址cid=self.Id。我通過跟蹤爲什麼但得到結果無效的請求。如何在iPhone應用中傳遞url中的字符串值?

NSURL *url = [NSURL URLWithString: 
    @"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS? 
    t=1&h=admin&last=0&cid=Self.Id&items=5"]; 
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; 
    [request setRequestMethod:@"GET"]; 
    [request setDidFailSelector:@selector(requestCompleted:)]; 
    [request setDelegate:self]; 
    [request startAsynchronous]; 

回答

3
[NSURL URLWithString:[NSString stringWithFormat:@"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS? 
    t=1&h=admin&last=0&cid=%@&items=5",Self.Id]]; 
+0

感謝它的工作 – 2014-11-01 10:36:43

相關問題