2
NSString* urlText = @"http://www2.htk.dk/Socialpsykiatrien/menuplan%20værestedet.pdf";
NSString* urlTextEscaped = [urlText stringByAddingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding];
NSURL *url = [NSURL URLWithString: urlTextEscaped];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
這是我的代碼。而且每次停在的NSURLRequest ......它看起來像它正確加載的網址壽 但我似乎無法找到錯誤nsurlrequest將不會加載pdf
所有的控制檯說的是:(LLDB)
您正在將轉義編碼添加到已經轉義的url中,它似乎已經在urlText中具有%20。 –
我也有鏈接中的æ... – KennyVB
試過這個aswelll NSURL * targetURL = [NSURL URLWithString:@「http://www2.htk.dk/Socialpsykiatrien/menuplan%20værestedet.pdf」]; NSURLRequest * request = [NSURLRequest requestWithURL:targetURL];並且它什麼都不加載 – KennyVB