Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

asheshsj

macrumors newbie
Original poster
Oct 30, 2008
5
0
My code below is causing memory leak. Can someone please have a look at it and give me a solution

NSData *data = [[NSData alloc] initWithContentsOfURL:imgurl];
[fileManager createDirectoryAtPath:imagePath attributes:nil];
[data writeToFile:imageFilePath atomically:NO];
[getProfile setObject:imageFilePath forKey:mad:"img"];
[testArray1 addObject:getProfile];
[data release];
[getProfile release];
}

Thanks,
A
 
just fyi for next time, use the code format in the text options next time you want to paste code. it's much easier to read that way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.