I am stuck in a very obvious method of NSURL class URLWithString I am passing a string and while creating URL it returns nil, my string is perfect. When ever I uses same string in browser then it is working fine. I am using following method to convert NSString to NSURL:
NSURL *url = [NSURL URLWithString:urlString];
//urlString is my perfect string
I have also tried to encode my string first by using following
NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
// using this line my output string when I log url is "url%10%10%10%10%10%10..."
%10 becomes the suffix of my url with around 100+ repetition.
If any one has idea what %10 is or what can be done to overcome this problem.
here is my urlString:
urlString? - rmaddy%10is a hex code. That's16in decimal which is a strange control character. Show whereurlStringcomes from and again, show its exact value. - rmaddyNSLog(@"urlString = \"%@\"", urlString);then update your question with the output from that log statement. - rmaddystringByTrimmingCharactersInSet:? Btw, if you've already found a solution (based on your comments) I think you could post your solution to help others in the future. - Islam Q.