xml parsing problem in iPhone -
i have xml feed in chinese, nsxlparsers unable parse. gives error 31 while parsing.
error 31 occur due document encoding unknown.
i tried utf-8 , ascii encodings convert string rendered via
[nsstring stringwithcontentsofurl:@"http://news.baidu.com/n?cmd=4&class=finannews&tn=rss"]
to corresponding format.
can body shed light on how parse xml feeds written in languages.
thanx in advance
try debugg using
- (void)parser:(nsxmlparser *)parser parseerroroccurred:(nserror *)parseerror { nsstring * errorstring = [nsstring stringwithformat:@"unable download story feed web site (error code %i )", [parseerror code]]; nslog(@"error parsing xml: %@", errorstring); uialertview * erroralert = [[uialertview alloc] initwithtitle:@"error loading content" message:errorstring delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil]; [erroralert show]; }
it find whether problem xml or encoding method
Comments
Post a Comment