surl를 재사용하고 있기 때문에 새는 것처럼 보입니다. 그러나 계기는 연결을 보여주지 않는다. 쓰레기 문자열을 만들지 않고도 재사용 할 수있는 방법을 이해하지 않아야합니다. 이 라인에서IOS 코드가 누출되는 이유는 무엇입니까?
NSString *rcode = @"DDD";
NSString *surl = [NSString stringWithFormat: @"http://www.myweather.com/%@_%@.png", rcode, @"7"];
NSURL *url = [NSURL URLWithString: surl];
UIImage *image7 = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
surl = [NSString stringWithFormat: @"http://www.myweather.com/%@_%@.png", rrcode, @"6"];
url = [NSURL URLWithString: surl];
UIImage *image6 = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
surl = [NSString stringWithFormat: @"http://www.myweather.com/%@_%@.png", rrcode, @"5"];
url = [NSURL URLWithString: surl];
UIImage *image5 = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
ObjC에 괜찮은 GC가 있습니까? – cHao
@cHao Mac OS X 개발을위한 목표 C는 GC를 사용할 수 있습니다. iOS의 경우 GC가 없습니다. 하지만 iOS 5 SDK를 사용하여 [ARC] (http://clang.llvm.org/docs/AutomaticReferenceCounting.html) –