How can get all cells of UITableView? - uitableview

I developed custom cell. which have one UITextfield. i want to clear textfield text on UIButton event. UIButton is also in tableView in another section.
i also tried visible cells but it's clear text only visible cells
so how can i clear all cell's textfield?
Can anyone help me?
Thanks

I was not got all cells but i reload tableView on my Button Event.
On CellForRowAtIndexPath
I was set txtField.text = #"";

Related

ios Tableview cell disappears when Selecting TextView

I have a tableview that has custom cells in it. The section header on the cell has a selectable textview.
When you double tap and select the textview then tap away from it... the cell literally disappears. But when I scroll completely so that the cell is out of visibility and go back then scroll back... the cell comes back.
Very confused as to why this is happening. Does anyone have any idea what would cause this issue???
Issue is specific to the Table view header section, if I have selectable textview in the other cells and tap away the cell doesn't disappear.
I think you are designed the View for header as a table view cell. The disappearing issue is may be due to two reasons
1.Please check the tableview and cell views scope you declared.If it is weak please make it as strong.
2.I will give u a sample code you need to declare in view for header delegate
If you returned cell instead of uiview it may happen.Please verify that one also.
static NSString *CellIdentifier = #"QuizCreation2HeaderTableViewCell";
QuizCreation2HeaderTableViewCell* sectionHeaderCell = (QuizCreation2HeaderTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UIView * headerView = [[UIView alloc] initWithFrame:sectionHeaderCell.frame];
[headerView addSubview:sectionHeaderCell];
return headerView;

In UITableViewController textfield.becomeFirstResponder() not scrolling the tableview

In UITableViewController have default property UITableView scroll when text field is selected, but it stop working if textfield selected using textfield.becomeFirstResponder().
Any help is appreciated.
textfield.becomefirstresponder() is not the same as being selected through uitableView. you'll have to select that cell as well

UIButtons in UITableViewCell do not show textLabel changes until cells scroll off screen

I have a UIViewController with a calendar and below it is a UITableView with a UITableViewCell that has a series of UIButtons that I change the button text depending on the data that I retrieve. When a date is selected I update a NSArray and call [self.tableView reloadData]. The first row populates as it should, the UIButton titles show the correct data. The rest of the rows show the default values for the UIButtons from the storyboard. If I scroll a cell off the screen and let it come back it displays the correct data (i.e. updates the titles of the UIButtons). I'm not sure why this is happening. I tried adding
[cell setNeedsLayout] before the cell is returned but it has not helped.
Are you modifying the testLabels directly? UIButtons have iffy behavior sometimes if you do. Try using the UIButton methods to change the textLabel's properties, such as setTitle: forState:

Display label in UITableview cell When its visible in Ios

I am new to iOS. I need to show the Label in timeDelay in UITableViewCell only when its visible?
Create a custom UITableView cell. In your cellForRowIndexPath, call the function performSelectorWithDelay which will show your UILabel.
When the cellForRowIndexPath is called, it's pretty certain that the cell will now be shown.

How can I make only one UITableView cell can be highlighted when selected?

I want to make only one cell to be highlighted when it's selected.
I can't use UITableViewCellSelectionStyleNone because I want other cells to be selectable and can be highlighted in edit mode.
Every comment will be appreciated.
Thanks
I figured out how to do this
Just use next two lines in viewDidLoad and made last cell has very big (enough to cover entire cell) UIButton.
self.tableView.allowsSelection = NO;
self.tableView.allowsSelectionDuringEditing = YES;

Resources