Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RSSAttachedMedia.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
NSString *type;
}

@property (nonatomic, retain) NSString *url;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, assign) int length;
@property (nonatomic, retain) NSString *type;
@property (nonatomic, strong) NSString *type;

@end

5 changes: 0 additions & 5 deletions RSSAttachedMedia.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ @implementation RSSAttachedMedia
@synthesize length;
@synthesize type;

- (void) dealloc {
self.url = NULL;
self.type = NULL;
[super dealloc];
}

@end

8 changes: 4 additions & 4 deletions RSSCloudService.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
NSString *protocol;
}

@property (nonatomic, retain) NSString *domain;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, assign) int port;
@property (nonatomic, retain) NSString *path;
@property (nonatomic, retain) NSString *procedure;
@property (nonatomic, retain) NSString *protocol;
@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) NSString *procedure;
@property (nonatomic, strong) NSString *protocol;

@end

7 changes: 0 additions & 7 deletions RSSCloudService.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ @implementation RSSCloudService
@synthesize procedure;
@synthesize protocol;

- (void) dealloc {
self.domain = NULL;
self.path = NULL;
self.procedure = NULL;
self.protocol = NULL;
[super dealloc];
}

@end

22 changes: 11 additions & 11 deletions RSSEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
NSString *author;
}

@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSString *url;
@property (nonatomic, retain) NSString *uid;
@property (nonatomic, retain) NSString *date;
@property (nonatomic, retain) NSString *summary;
@property (nonatomic, retain) NSMutableArray *categories;
@property (nonatomic, retain) NSString *comments;
@property (nonatomic, retain) NSString *content;
@property (nonatomic, retain) NSString *copyright;
@property (nonatomic, retain) RSSAttachedMedia *attachedMedia;
@property (nonatomic, retain) NSString *author;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *uid;
@property (nonatomic, strong) NSString *date;
@property (nonatomic, strong) NSString *summary;
@property (nonatomic, strong) NSMutableArray *categories;
@property (nonatomic, strong) NSString *comments;
@property (nonatomic, strong) NSString *content;
@property (nonatomic, strong) NSString *copyright;
@property (nonatomic, strong) RSSAttachedMedia *attachedMedia;
@property (nonatomic, strong) NSString *author;

@end

15 changes: 0 additions & 15 deletions RSSEntry.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,9 @@ - (id) init {
self = [super init];
NSMutableArray *theCategories = [[NSMutableArray alloc] init];
self.categories = theCategories;
[theCategories release];
return self;
}

- (void) dealloc {
self.title = NULL;
self.url = NULL;
self.uid = NULL;
self.date = NULL;
self.summary = NULL;
self.categories = NULL;
self.comments = NULL;
self.content = NULL;
self.copyright = NULL;
self.attachedMedia = NULL;
self.author = NULL;
[super dealloc];
}

@end

26 changes: 13 additions & 13 deletions RSSFeed.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
}

@property (nonatomic, assign) RSSFeedType type;
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSString *description;
@property (nonatomic, retain) NSString *url;
@property (nonatomic, retain) NSString *date;
@property (nonatomic, retain) NSString *author;
@property (nonatomic, retain) NSMutableArray *articles;
@property (nonatomic, retain) NSString *uid;
@property (nonatomic, retain) NSString *language;
@property (nonatomic, retain) NSString *copyright;
@property (nonatomic, retain) NSMutableArray *categories;
@property (nonatomic, retain) NSString *generator;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSString *description;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *date;
@property (nonatomic, strong) NSString *author;
@property (nonatomic, strong) NSMutableArray *articles;
@property (nonatomic, strong) NSString *uid;
@property (nonatomic, strong) NSString *language;
@property (nonatomic, strong) NSString *copyright;
@property (nonatomic, strong) NSMutableArray *categories;
@property (nonatomic, strong) NSString *generator;
@property (nonatomic, assign) NSTimeInterval validTime;
@property (nonatomic, retain) NSString *iconUrl;
@property (nonatomic, retain) RSSCloudService *cloudService;
@property (nonatomic, strong) NSString *iconUrl;
@property (nonatomic, strong) RSSCloudService *cloudService;


@end
Expand Down
18 changes: 0 additions & 18 deletions RSSFeed.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,11 @@ - (id) init {
self = [super init];
NSMutableArray *theArticles = [[NSMutableArray alloc] init];
self.articles = theArticles;
[theArticles release];
NSMutableArray *theCategories = [[NSMutableArray alloc] init];
self.categories = theCategories;
[theCategories release];
return self;
}

- (void) dealloc {
self.title = NULL;
self.description = NULL;
self.url = NULL;
self.date = NULL;
self.author = NULL;
self.articles = NULL;
self.uid = NULL;
self.language = NULL;
self.copyright = NULL;
self.categories = NULL;
self.generator = NULL;
self.iconUrl = NULL;
self.cloudService = NULL;
[super dealloc];
}

@end

8 changes: 4 additions & 4 deletions RSSParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
@protocol RSSParserDelegate;


@interface RSSParser: NSObject {
@interface RSSParser: NSObject <NSXMLParserDelegate> {
NSString *url;
NSXMLParser *xmlParser;
NSMutableArray *tagStack;
NSMutableString *tagPath;
RSSFeed *feed;
RSSEntry *entry;
id <RSSParserDelegate> delegate;
id <RSSParserDelegate> __weak delegate;
}

@property (nonatomic, assign) id <RSSParserDelegate> delegate;
@property (nonatomic, retain) NSString *url;
@property (nonatomic, weak) id <RSSParserDelegate> delegate;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, assign) BOOL synchronous;

- (id) initWithUrl:(NSString *)theUrl synchronous:(BOOL)sync;
Expand Down
17 changes: 0 additions & 17 deletions RSSParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ - (id) initWithUrl:(NSString *)theUrl synchronous:(BOOL)sync {
if (self.synchronous) {
NSURL *contentUrl = [[NSURL alloc] initWithString:self.url];
xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:contentUrl];
[contentUrl release];
[xmlParser setDelegate:self];
}
return self;
Expand All @@ -41,9 +40,6 @@ - (id) init {

- (void) dealloc {
[xmlParser setDelegate:NULL];
[xmlParser release];
self.url = NULL;
[super dealloc];
}

// self
Expand All @@ -52,7 +48,6 @@ - (void) parse {
if (!self.synchronous) {
NSURL *contentUrl = [[NSURL alloc] initWithString:self.url];
xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:contentUrl];
[contentUrl release];
[xmlParser setDelegate:self];
}
[xmlParser parse];
Expand All @@ -67,18 +62,12 @@ - (void) parserDidStartDocument:(NSXMLParser *)parser {
}

- (void) parserDidEndDocument:(NSXMLParser *)parser {
[tagStack release];
[tagPath release];
if ([delegate respondsToSelector:@selector(rssParser:parsedFeed:)]) {
[delegate rssParser:self parsedFeed:feed];
}
[feed release];
}

- (void) parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)error {
[tagStack release];
[tagPath release];
[feed release];
if ([delegate respondsToSelector:@selector(rssParser:errorOccurred:)]) {
[delegate rssParser:self errorOccurred:error];
}
Expand All @@ -100,9 +89,7 @@ - (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)element namesp
[context setObject:attributes forKey:@"attributes"];
NSMutableString *text = [[NSMutableString alloc] init];
[context setObject:text forKey:@"text"];
[text release];
[tagStack addObject:context];
[context release];
[tagPath appendPathComponent:element];
}

Expand Down Expand Up @@ -155,7 +142,6 @@ - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)element namespac
cloudService.procedure = [attributes objectForKey:@"registerProcedure"];
cloudService.protocol = [attributes objectForKey:@"protocol"];
feed.cloudService = cloudService;
[cloudService release];
} else if ([tagPath isEqualToString:@"/rss/channel/lastBuildDate"] || [tagPath isEqualToString:@"/feed/updated"]) {
feed.date = text;
} else if ([tagPath isEqualToString:@"/rss/channel/managingEditor"]) {
Expand Down Expand Up @@ -200,7 +186,6 @@ - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)element namespac
media.length = [[attributes objectForKey:@"length"] intValue];
media.type = [attributes objectForKey:@"type"];
entry.attachedMedia = media;
[media release];
} else if ([tagPath isEqualToString:@"/rss/channel/item/guid"] || [tagPath isEqualToString:@"/feed/entry/id"]) {
entry.uid = text;
} else if ([tagPath isEqualToString:@"/rss/channel/item/pubDate"] || [tagPath isEqualToString:@"/feed/entry/updated"]) {
Expand All @@ -209,7 +194,6 @@ - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)element namespac
entry.copyright = text;
} else if ([tagPath isEqualToString:@"/rss/channel/item"] || [tagPath isEqualToString:@"/feed/entry"]) {
[feed.articles addObject:entry];
[entry release];
}
[tagStack removeLastObject];
[tagPath deleteLastPathComponent];
Expand All @@ -226,7 +210,6 @@ - (void) parser:(NSXMLParser *)parser foundCDATA:(NSData *)data {
NSMutableDictionary *context = [tagStack lastObject];
NSMutableString *text = [context objectForKey:@"text"];
[text appendString:string];
[string release];
}

@end
Expand Down