PDA

View Full Version : Canonical URL




McBgnr
May 28, 2009, 04:41 AM
Hello,

I wanted to extract the URL from cookes.plist (Safari). However the value for the cookie has some special characters. Thus as it is, this value cannot be used with the browser. How can I convert the value to canonical form so that I can use it for opening in a browser. I had tried using [NSURLProtocol canonicalRequestforRequest], but it did not work :-(

Suggestions are welcome.



McBgnr
May 28, 2009, 06:20 AM
Hello,

I came across a function stringByReplacingPercentEscapesUsingEncoding:
However when I tried using it as in


NSString* imageUrl = @"http://www.myurl.com/image.jpg";
NSString* mapUrl = [imageUrl stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];


I am getting compile error saying:
error: syntax error at the end of input
warning:'@end' missing in implementation context

Any idea what this means.

robbieduncan
May 28, 2009, 06:27 AM
I am getting compile error saying:
error: syntax error at the end of input
warning:'@end' missing in implementation context

Any idea what this means.

Most likely you have either not put @end at the end of your class definition or have failed to close a {} bracket set somewhere...

McBgnr
May 28, 2009, 07:04 AM
Oops... it was a missing closing brace.

Thanks for the helpful reply. Solved no :-)