Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在iPhone应用程序中传递url中的字符串值?_Ios_Objective C - Fatal编程技术网

Ios 如何在iPhone应用程序中传递url中的字符串值?

Ios 如何在iPhone应用程序中传递url中的字符串值?,ios,objective-c,Ios,Objective C,我有这个URL我想在这个URLcid=Self.Id中传递Self.Id。我通过了为什么,但得到的结果是无效的请求 NSURL *url = [NSURL URLWithString: @"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS? t=1&h=admin&last=0&cid=Self.Id&items=5"]; ASIHTTPRequest

我有这个URL我想在这个URL
cid=Self.Id
中传递
Self.Id
。我通过了为什么,但得到的结果是无效的请求

    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];
[NSURL URLWithString:[NSString stringWithFormat:@"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS?
     t=1&h=admin&last=0&cid=%@&items=5",Self.Id]];