0
I have a problem trying to send a request via get for a Webview to open the contents of a page, when I pass the concatenated parameters an error occurs, I believe it is for encoding reasons this only occurs when I pass parameters with special characters, Could anyone assist me in this matter? Follow the code I’m using.
NSString *titulo = [listDictionary objectForKey:@"titulo"];
NSString *imagem = [listDictionary objectForKey:@"imagem"];
NSString *descricao = [listDictionary objectForKey:@"descricao"];
NSString *getString = [NSString stringWithFormat:@"https://meudominio.com.br/web.php?titulo=%@&image=%@&conteudo=%@", titulo, imagem, descricao];
getString = [getString stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSURL *url = [NSURL URLWithString:getString];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webview loadRequest:requestObj];
Can you report the error you are experiencing? Try using UTF8 encoding (Nsutf8stringencoding)
– Lucas Eduardo