Note that there are some explanatory texts on larger screens.

plurals
  1. POText in UITextField disappear when scrolling in custom cell (xib)
    primarykey
    data
    text
    <p>I have read a lot about my issue and I still cannot pointout the exact problem. I have tried some if the code here in stack but it I keep getting errors. The code below works but vanish the text on scrolling.</p> <p>Any ideas?</p> <p>GetQuestionsCustomCell.h:</p> <pre><code>@interface GetQuestionsCustomCell : UITableViewCell &lt;UITextFieldDelegate&gt; @property (strong, nonatomic) IBOutlet UILabel *labelQuestion; @property (strong, nonatomic) IBOutlet UITextField *textFieldAnswer; @property (strong, nonatomic) IBOutlet UILabel *labelQuestionNumber; - (IBAction)KeyDown:(id)sender; @end </code></pre> <p>GetQuestionsCustomCell.m:</p> <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code NSArray *nibArray = [[NSBundle mainBundle] loadNibNamed:@"GetQuestionsCustomCell" owner:self options:nil]; self = [nibArray objectAtIndex:0]; self.textFieldAnswer.delegate = self; } return self; } </code></pre> <p>SecurityQuestions.m:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; GetQuestionsCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[GetQuestionsCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } NSInteger nextIndexPathRow = indexPath.row; nextIndexPathRow++; cell.labelQuestion.text = [arrayOfQuestions objectAtIndex:indexPath.row]; cell.labelQuestionNumber.text = [NSString stringWithFormat:@".%d", nextIndexPathRow]; switch (indexPath.row) { case 0: tfA1 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 1: tfA2 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 2: tfA3 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 3: tfA4 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 4: tfA5 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 5: tfA6 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 6: tfA7 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 7: tfA8 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 8: tfA9 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 9: tfA10 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 10: tfA11 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; case 11: tfA12 = (UITextField*)[cell.contentView viewWithTag:nextIndexPathRow]; break; } return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload