Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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, 05:38 PM   #9 (permalink)
starwarsdevwookie59
Registered Member
 
Join Date: Mar 2009
Posts: 123
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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,314
Threads: 39,112
Posts: 171,494
Top Poster: smasher (2,576)
Welcome to our newest member, biggybillly
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:12 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.