I´m trying to do a GET request to my web service, using AFNetworking(great framework). This is the code for the request:
AFHTTPClient *httpClient = [[AFHTTPClient alloc]initWithBaseURL:[NSURL URLWithString:@"http://mywebservice.com/service/"]];
[httpClient setParameterEncoding:AFJSONParameterEncoding];
[httpClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
NSMutableURLRequest *request = [httpClient getPath:@"http://mywebservice.com/service/contacts"
parameters:@{@"accessID":self.accessId, @"name":contactName}
success:^(AFHTTPRequestOperation *operation, id responseObject) {
//Success code
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//Error code
}];
This causes the following issue to appear(pointing at my NSMutableURLRequest instance): Initializing 'NSMutableURLRequest *__strong' with an expression of incompatible type 'void'
I have no idea what causes this, so any help would be appreciated.