I am subclassing NSURLConnection and experiencing a memory leak for the initWithRequest method for the NSURLRequest object. The init method is shown below:
Any ideas why this would be occurring?
Code:
- (id)initWithRequest:(NSURLRequest *)request fileName:(NSString *)newName fileType:(FileType)newType delegate:(id)delegate {
if (self = [super initWithRequest:request delegate:delegate]) {
self.targetURL = [[request URL] absoluteString];
self.totalFileSize = 0;
self.totalDownloaded = 0;
self.fileName = newName;
self.fileType = newType;
self.receivedData = [NSMutableData data];
}
return self;
}
- (void)dealloc {
[self.receivedData release];
[self.fileName release];
[self.downloadPath release];
[self.targetURL release];
[super dealloc];
}
Any ideas why this would be occurring?