我有以下問題:的UIViewController與文本框和的tableView
我有一個UIViewController,它包含一個文本框和一個實現代碼如下。我從另一個視圖推動視圖,這樣我就得到了一個導航欄。我啓用了編輯按鈕,導航也可以正常工作。 我的問題是: - 編輯按鈕不起作用。我正在通過這裏查看,但我無法修復它 - 當我輸入數據到文本框時,tableview獲取數據,重新加載正在工作,但它不顯示任何動畫,也沒有添加行。 ..
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[controller insertCostumer:textField.text];
[textField resignFirstResponder];
[tabViewitem reloadData];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:controller.sizeOfNavi+1 inSection:1];
NSMutableArray *arr = [[NSMutableArray alloc]init];
[arr addObject:indexPath];
[tabViewitem insertRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationTop];
return YES;
}
這是我textfieldshouldreturn方法,我也嘗試了textfieldshouldendediting和textfielddidendediting等:-) 希望有人有任何線索如何做到這一點。
您是否嘗試過先插入一行然後重新載入表格? – Vanya
現在會做一個解決方法......設置一個標誌並以不同的方式編輯整個事物......不知道該怎麼做。 無論如何,如果有人發現了什麼,請讓我知道。 – markus
@Vanya,是試過了太:-) – markus