Hi, im trying to get data via
NSString *string = [NSString stringWithContentsOfURL: [NSURL URLWithString: url]];
everything works fine, but when I run it with performance tool, it finds leaks on this line.
Here is whole mehod I use:
- (NSMutableDictionary *) getOutputImagesData: (URLParserImagesData) data
{
NSString *type = (data == URLParserImagesDataLatestImage) ? @"img" : @"size";
NSString *url = [NSString stringWithFormat: @"%s%s%s", [URLParserSiteURLforCategories UTF8String], [URLParserType UTF8String], [type UTF8String]];
//i get leaks here
NSString *string = [NSString stringWithContentsOfURL: [NSURL URLWithString: url]];
NSArray *imagesTemp = [string componentsSeparatedByString: @","];
NSMutableDictionary *outputImages = [NSMutableDictionary dictionary];
for(NSString *img in imagesTemp)
{
NSArray *splitStrings = [img componentsSeparatedByString: @"="];
if(data == URLParserImagesDataImagesCount)
{
NSNumber *integerValue = [NSNumber numberWithInt: [[splitStrings objectAtIndex:1] intValue]];
[outputImages setObject: integerValue forKey: [splitStrings objectAtIndex:0]];
}
else
[outputImages setObject: [splitStrings objectAtIndex:1] forKey: [splitStrings objectAtIndex:0]];
}
return outputImages;
}