-3
this is my screenshot [我寻找这个解决方案,但没有得到任何解决方案。为什么它会显示我在屏幕截图中显示的错误。请帮帮我。不可见@interface for nsmutableurlrequest声明选择器sethttpbody
NSURL *url=[NSURL URLWithString:@"http://www.gourmet7.com/auth"];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *response = nil;
NSData *urlData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"Response code: %ld", (long)[response statusCode]);
NSString *responseData = [[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
] 2
我是新来的ios。请给我一个解决方案,我正在使用xcode 7.2 – Sandy
到目前为止您尝试过什么? – Genzotto
我想提出要求。我不明白什么是错的。 @Genzotto你是否得到我的问题。 – Sandy