Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: RSS Reader
View Single Post
Old 06-20-2009, 06:38 PM   #9 (permalink)
starwarsdevwookie59
Registered Member
 
Join Date: Mar 2009
Posts: 157
Default

Quote:
Originally Posted by smithdale87 View Post
When I get that error, it most likely means that the XML is not formatted correctly, either a tag didnt get closed when it should have something like that..

In order to determine exactly where in the feed the problem occurs, I like to print out the name of the elements in the didStartElement and didEndElement parser delegate methods.

Code:
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
{
     NSLog(@"<%@>", elementName);

// do other stuff
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
    NSLog(@"</%@>", elementName);
}

Now you should be able to see what element you were on when the error gets thrown. Just look @ the console output.
Nice. Good idea. I put the code in just like you put it, along with the other stuff in the function. But all that's coming up in the console is:

Code:
[Session started at 2009-06-20 18:33:20 -0400.]
2009-06-20 18:33:22.696 TAB RSS reader[12695:20b] error parsing XML: Unable to download story feed from web site (Error code 5 )
I can't thank you enough for helping me with this. I appreciate your helpful replies.
starwarsdevwookie59 is offline   Reply With Quote
 

» Advertisements
» Online Users: 769
22 members and 747 guests
ADY, ajaysharma, AppleSteve, ckgni, clovisbear, Domele, Floras2324, hain, ilmman, jkigel, JohniARivera, KarlJay, manojb, MozyMac, NoGameJoe, oceanlablight, saqibjaan, shenehashri, smarkmee, suresk, tJuleeByrdc
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,623
Threads: 89,142
Posts: 380,331
Top Poster: BrianSlick (7,110)
Welcome to our newest member, smarkmee
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.