UITableviews, 스택 및 구성 요소 제거 또는 스택의 구성 요소 숨기기와 관련하여 질문이 있습니다. 먼저 컴포넌트 (버튼)를 추가하는 함수가 있습니다.removeFromSuperView ... 모든 컨트롤러 뷰에서 모든 구성 요소를 제거하려면 어떻게해야합니까?
-(void)addComponent
{
[self.navigationController.view addSubview:playButton];
}
내가 너무 좋아, 지금까지
내
didSelectRowAtindexPath
이 함수를 호출합니다."재미"부분이 있습니다.
은 내가 barbuttonitem 스택
-(void)lastView:(id)sender
{
selectedRow = [self.tableView indexPathForSelectedRow];
NSUInteger row = selectedRow.row;
NSUInteger section = selectedRow.section;
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:section] animated:YES scrollPosition:UITableViewScrollPositionBottom];
[self tableView:[self tableView] didSelectRowAtIndexPath:selectedRow];
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:selectedRow.row];
//Get the children of the present item.
NSArray *Children = [dictionary objectForKey:@"Children"];
rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
//Increment the Current View
rvController.CurrentLevel += 1;
//Push the new table view on the stack
[self.navigationController pushViewController:rvController animated:NO];
rvController.tableDataSource = Children;
[rvController release];
}
}
나는 화면에서을 playButton 제거 할,하지만 불행히도 removeFromSuperView이 작동하지 않습니다에 다음 컨트롤러를 밀어
에 연결되어 다른 기능을 가지고있다. 나는이 일을 할 때 내 버튼을 완벽하게 제거하기 때문에 새로운 rvController를 스택에 밀어 넣는 것과 관련이 있다고 생각한다.
아무도 단서에 스택에있는 모든보기에서 단추가 제거되었는지 그리고 현재의 "보기"가 아닌지 확인하는 방법에 대한 단서가 있습니까?
편집 : 나는 여기에 몇 가지 가짜 코드를 삽입하는 경우 여기
는 (하지만 다른의 ViewController를 밀어 것)이 같은 또 다른 "재미"일부 입니다 :
-(void)lastView:(UITableview *)tableView selectingRow:(NSIndexPath *)indexPath
{
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
//Get the children of the present item.
NSArray *Children = [dictionary objectForKey:@"Children"];
rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
//Increment the Current View
rvController.CurrentLevel += 1;
//Push the new table view on the stack
[self.navigationController pushViewController:rvController animated:NO];
rvController.tableDataSource = Children;
[rvController release];
}
}
그런 다음 그것을 작동하는 것 같다. 비록 내가 정말로 확신하지는 않지만 그것이 효과가있는 것처럼 보이게한다.
몇 개의 버튼 인스턴스가 있습니까? – Daniel
하나의 인스턴스를 만들었습니다. –