nsurlconnection - How to get text file from the URL objective c? -
currently i'm working on translate application , referred read text file returned url translated text file
https://translate.google.com.tw/translate_a/t?client=t&hl=en&sl=" + sl + "&tl=" + tl + "&ie=utf-8&oe=utf-8&multires=1&oc=1&otf=2&ssel=0&tsel=0&sc=1&q=" .this works fine in android while translate, in ios returns text below code used file
nsurlrequest *request = [nsurlrequest requestwithurl:[nsurl urlwithstring:@"http://translate.google.com.tw/translate_a/t?client=t&hl=en&sl=en&tl=ta&ie=utf-8&oe=utf-8&multires=1&oc=1&otf=2&ssel=0&tsel=0&sc=1&q=summer"] cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:60.0]; connectionrequest=[[nsurlconnection alloc]initwithrequest:request delegate:self]; nsstring* newstr = [[nsstring alloc] initwithdata:responsedata encoding:nsutf8stringencoding]; nslog(@"newstr%@",newstr);
what i'm doing?please me out of this..thanks
i recommend using web service rest of google. can read official guide. enter link description here
Comments
Post a Comment