난 그냥 내 프로젝트에 연타하다 정적 분석기를 실행 호출자가이 시점에서 소유하지 않은 객체의 참조 횟수를 잘못 감소, 나는 다음과 같은 경고 수신하고 있습니다 :CSA 경고 :
Incorrect decrement of the reference count of an object that is not owned at this point by the caller
내 문제가 무엇인지 말해 주실 수 있습니까? 나는 보통 내 애플 리케이션에서 사용되는 메모리를 잘 관리 할 수있다.
self.cupboardViewController = [[CupboardViewController alloc] initWithNibName:@"CupboardViewController" bundle:[NSBundle mainBundle]];
[self.window addSubview:self.cupboardViewController.view];
- (void)dealloc {
[[self cupboardViewController] release];//where I am getting the warning.
[super dealloc];
}
'cupboardViewController'가'retain'으로 표시되었다고 가정하면, 예제의 첫 번째 줄에 생성 한 새 객체가 자동으로 유지되므로 관계없이이 객체를 유출하게됩니다. 속성에 속성을 할당하기 전에 해당 객체를 자동 갱신해야합니다. autoclease = "[[CupboardViewController alloc] init ...] autorelease];'. –
그랬지만 잠시 후에 응용 프로그램이 충돌하는 원인이되었습니다. –