0
我創建了一個帶有textField和一個帶有textView的customCells的UITableView。當用戶按下標題爲「完成」的UIBarButtonItem時,我想保存textField值,但是如何在cellForRowAtIndexPath之外訪問這些值?獲取函數中的cell.textField值
我創建了一個帶有textField和一個帶有textView的customCells的UITableView。當用戶按下標題爲「完成」的UIBarButtonItem時,我想保存textField值,但是如何在cellForRowAtIndexPath之外訪問這些值?獲取函數中的cell.textField值
你可以試試這個:
for (int i = 0; i < [self.tableView numberOfRowsInSection:0]; i++) {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]];
// do something with cell
}
讓他們的參考名單 – 2014-09-19 17:06:47
ü可以舉一個例子 – Frederik 2014-09-20 23:08:48