Ragul
Ragul

Reputation: 3186

too many arguments to method call expected 1 have 3

Please help me to find the error, my code is

NSURL *url = [NSURL URLWithString: @"http://www.xxxx.com/xxxx_webservice/login.php?user=%@&pass=%@&format=json",Username,Password];

Screenshot

Upvotes: 0

Views: 984

Answers (1)

Dhrumil
Dhrumil

Reputation: 3204

Do it like this. First make a proper string of your URL and then encode it and then finally make it a NSURL. Make sure your passing the correct and right set of parameters.

NSString *link = [NSString stringWithFormat:@"http://www.example.com/xx_webservice/login.php?user=%@&pass=%@&format=json",Username,Password];
NSString *encdLink = [link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url=[NSURL URLWithString:encdLink];

Upvotes: 7

Related Questions