簡體   English   中英

添加按鈕不要在 tableView 上添加新行

[英]Add button don't add new row on the tableView

我添加了我的按鈕以及包含數組的 tableView,我希望當我單擊按鈕添加它時,它會在將顯示在 tableViewController 上的數組中添加 textField 的內容

-(void) add:(UIButton *)sender{
    [tableViewController._myArray addObject:headerView._searchTextField.text ];
}

當您更新 tableview 的數據源時,您需要重新加載 tableview 以查看您缺少 tableview 控制器的 reloadData 方法的更新更改:-

-(void) add:(UIButton *)sender{
    [tableViewController._myArray addObject:headerView._searchTextField.text ];
    [tableview reloadData]; // considering tableview is you variable holding reference of UITableView
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM