Skip to content

Commit

Permalink
working on feed reader
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseclark committed Aug 3, 2008
1 parent e8dd50e commit fee2600
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
16 changes: 9 additions & 7 deletions native/Classes/ThemeFeedReader.m
Expand Up @@ -48,16 +48,16 @@ - (id)init
{
[super init];

[self.kulerElementNames initWithObjects:
@"link",
@"kuler:themeID",
@"kuler:themeTitle",
self.kulerElementNames = [NSArray arrayWithObjects:
@"link",
@"kuler:themeID",
@"kuler:themeTitle",
@"kuler:authorID",
@"kuler:authorLabel",
@"kuler:themeDownloadCount",
@"kuler:themeCreatedAt",
@"kuler:themeEditedAt"];

@"kuler:themeEditedAt", nil];
return self;
}

Expand Down Expand Up @@ -98,7 +98,9 @@ - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName nam
NSLog(@"max themes reached.");
[parser abortParsing];
}


NSLog(@"we found the element %@", elementName );

if ([elementName isEqualToString:@"item"]) {

parsedItemsCounter++;
Expand Down
1 change: 0 additions & 1 deletion native/Classes/kuler_iphoneAppDelegate.h
Expand Up @@ -27,4 +27,3 @@
- (void)getList:(id *)objsPtr range:(NSRange)range;

@end

6 changes: 4 additions & 2 deletions native/Classes/kuler_iphoneAppDelegate.m
Expand Up @@ -51,6 +51,9 @@ - (void)getThemeData

ThemeFeedReader *streamingParser = [[ThemeFeedReader alloc] init];
[streamingParser parseXMLFileAtURL:[NSURL URLWithString:feedURLString] parseError:&parseError];
// TODO: I am going to change from using the SAX style parseXMLFileAt to a DOM oriented method like xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl...
// see: http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/Articles/CreatingXMLDoc.html#//apple_ref/doc/uid/TP40001255

[streamingParser release];
[pool release];

Expand Down Expand Up @@ -91,8 +94,7 @@ - (void)addToThemeList:(Theme *)newTheme
{
NSLog(@"new theme: %@", newTheme);
[self.list addObject:newTheme];
// The XML parser calls addToEarthquakeList: each time it creates an earthquake object.
// The table needs to be reloaded to reflect the new content of the list.
// The XML parser calls addToThemeList: each time it creates a Theme object.
[self reloadTable];
}

Expand Down

0 comments on commit fee2600

Please sign in to comment.