diff --git a/RSSAttachedMedia.h b/RSSAttachedMedia.h index 954b62c..c4a3868 100755 --- a/RSSAttachedMedia.h +++ b/RSSAttachedMedia.h @@ -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 diff --git a/RSSAttachedMedia.m b/RSSAttachedMedia.m index be0dc3d..cf95e44 100755 --- a/RSSAttachedMedia.m +++ b/RSSAttachedMedia.m @@ -15,11 +15,6 @@ @implementation RSSAttachedMedia @synthesize length; @synthesize type; -- (void) dealloc { - self.url = NULL; - self.type = NULL; - [super dealloc]; -} @end diff --git a/RSSCloudService.h b/RSSCloudService.h index 8aa5265..7114da8 100755 --- a/RSSCloudService.h +++ b/RSSCloudService.h @@ -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 diff --git a/RSSCloudService.m b/RSSCloudService.m index 1d77443..b60899c 100755 --- a/RSSCloudService.m +++ b/RSSCloudService.m @@ -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 diff --git a/RSSEntry.h b/RSSEntry.h index a6d2518..a225e9b 100755 --- a/RSSEntry.h +++ b/RSSEntry.h @@ -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 diff --git a/RSSEntry.m b/RSSEntry.m index 452eae7..370271c 100755 --- a/RSSEntry.m +++ b/RSSEntry.m @@ -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 diff --git a/RSSFeed.h b/RSSFeed.h index 483fb12..2e8a739 100755 --- a/RSSFeed.h +++ b/RSSFeed.h @@ -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 diff --git a/RSSFeed.m b/RSSFeed.m index 1bc24ba..a814d4c 100755 --- a/RSSFeed.m +++ b/RSSFeed.m @@ -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 diff --git a/RSSParser.h b/RSSParser.h index 5e4a871..05328a9 100755 --- a/RSSParser.h +++ b/RSSParser.h @@ -14,18 +14,18 @@ @protocol RSSParserDelegate; -@interface RSSParser: NSObject { +@interface RSSParser: NSObject { NSString *url; NSXMLParser *xmlParser; NSMutableArray *tagStack; NSMutableString *tagPath; RSSFeed *feed; RSSEntry *entry; - id delegate; + id __weak delegate; } -@property (nonatomic, assign) id delegate; -@property (nonatomic, retain) NSString *url; +@property (nonatomic, weak) id delegate; +@property (nonatomic, strong) NSString *url; @property (nonatomic, assign) BOOL synchronous; - (id) initWithUrl:(NSString *)theUrl synchronous:(BOOL)sync; diff --git a/RSSParser.m b/RSSParser.m index 9ba2105..defbc1e 100755 --- a/RSSParser.m +++ b/RSSParser.m @@ -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; @@ -41,9 +40,6 @@ - (id) init { - (void) dealloc { [xmlParser setDelegate:NULL]; - [xmlParser release]; - self.url = NULL; - [super dealloc]; } // self @@ -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]; @@ -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]; } @@ -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]; } @@ -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"]) { @@ -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"]) { @@ -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]; @@ -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