popOver에서 tableView로 구성된 메뉴 만 표시하는 함수를 작성하고 있습니다. 동일한 함수에서 alloc이 하나 뿐인 객체에 대해 다섯 개의 할당이 있습니다.
이
는 소스 코드 : 카운트가 1if ([pop isPopoverVisible])
{
[pop dismissPopoverAnimated:YES];
[pop release];
}
pop = [[UIPopoverController alloc] initWithContentViewController:searchNav];
NSLog(@"Retain Count: %d",[searchNav retainCount]);
//At this point retain count is 2
[pop presentPopoverFromRect:btnMenu.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[pop setPopoverContentSize:CGSizeMake(350,600)];
NSLog(@"Retain Count: %d",[searchNav retainCount]);
//At this point retain count is 5!!!
[searchNav release];
}
나는 데 문제입니다 유지
-(void)pushSearch:(NSString *)option type:(int)optionType
{
searchNav = [[iNavigation alloc] initWithNibName:@"iNavigation" bundle:nil] ;
//This is the UIViewController with the tableView
[searchNav setSearchMode:optionType];
searchNav.view.frame =CGRectMake(0,0,300,600);
NSLog(@"Retain Count: %d",[searchNav retainCount]);
//이 시점에서의 tableview를로드하기 위해 사용 된 메모리가 있다는 것이다 결코 풀려나 지 않았다. 내 앱이 크래시 될 때까지 메모리가 커지고 커집니다.
왜 내가 searchNav에 대한 할당을 하나만 만들고, popOver에 할당 한 후 왜곡 계산은 5입니까?
도와주세요.
'[retaincount] 태그가 자동으로'[retaincount-is-evil-stopit-stopit-stop]'으로 리디렉션 될 수 있습니까? – walkytalky