uinavigationbar에 버튼을 추가하여 uitablview의 모든 행을 삭제하는 데 사용하고 싶습니다.
어떻게 할 수 있습니까?
[self.tableView reloadData]
여기서 일하지 않는다
버튼 액션 이벤트에서 itemArray에서 모든 객체를 제거한 다음 tableView 데이터를 다시로드합니다. 이 전에 tableView delegate numberOfRowInsection에서 다음과 같이 itemArray 개수를 전달하는지 확인하십시오.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [itemArray count];
}
// button action//
-(IBAction)deleteTableViewData
{
[itemArray removeAllObjects];
[tableView reloadData];
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다