2010年8月9日

NSData dataWithContentsOfURL has memory leak problem

NSData dataWithContentsOfURL has memory leak problem.

Should use it like below.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// ** Your Operations **

NSData *data = [NSData dataWithContentsOfURL:someURL];

// ** Your Operation **

[pool release];

没有评论: