여기에 게시하기 전에 최선을 다했습니다. 아래는 메모리 누수의 원인이되는 코드입니다. autorelease를 포함하면 메모리 누출 문제를 해결할 수 있지만 여기에서 내가 뭘 잘못하고 있는지 알고 싶어합니다. 내가 소유하고 있다면, 나는 그것을 풀어 줘야한다. 내가하려고하는 것은 다음과 같다. 미리 도움을 청한다. ContainerView는 UIView이며 환영 텍스트를 추가하고 있습니다.UIImageView를 릴리스하고 여전히 메모리 누수가 발생했습니다.
UIImageView *welcomeText = [[UIImageView alloc] init];
welcomeText = [[UIImageView alloc] initWithFrame:CGRectZero];
welcomeText.frame = (CGRect) { CGRectGetMidX(containerView.frame) -295 , 100.0, 590,134 };
welcomeText.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
welcomeText.image = [UIImage imageNamed:@"welcome-to-the-jungle.png"];
[containerView addSubview:welcomeText];
[welcomeText release];
"autorelease를 포함하면 메모리 누수가 수정됩니다."라는 말은 이미지보기를 자동 실행하고 해당 릴리스를 호출한다는 의미입니까? (BTW, 우스운 그림 이름) – Merky