Memory Leak

Discussion in 'iOS Programming' started by asheshsj, Jan 22, 2009.

  1. asheshsj macrumors newbie

    Oct 30, 2008
    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];

  2. macfanboy macrumors 6502a

    Jun 5, 2007
    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.

Share This Page