Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to insert UITextField at Top row in iphone app
    primarykey
    data
    text
    <p>I am making an iphone app in which i want that when app load it should just one cell with textfield when user enter any data in first cell it should new cell with entered data and first cell should be empty as editable. I am making but it shows same value in above cell also.</p> <p><img src="https://i.stack.imgur.com/J7fHR.png" alt="enter image description here"></p> <p>here is the code </p> <pre><code> -(UITableViewCell *)tableView:(UITableView *)atableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; if (!cell) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; cell.backgroundView = [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"tabelsales.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ]; cell.backgroundColor = [UIColor clearColor]; } if (indexPath.section==0) { tagInputField =[[UITextField alloc]initWithFrame:CGRectMake(13, 6, 250, 26)]; tagInputField.tag = 2; tagInputField.delegate = self; tagInputField.clearButtonMode = UITextFieldViewModeWhileEditing; tagInputField.font=[UIFont fontWithName:@"Myriad-Pro" size:8]; [tagInputField setText:@" "]; tagInputField.textColor =[UIColor grayColor]; [cell addSubview:tagInputField]; cell.textLabel.text=@""; return cell; } if (indexPath.section==1) { UIButton *crossButton =[[UIButton alloc]initWithFrame:CGRectMake(230, 8, 18, 18)]; //crossButton.backgroundColor = [UIColor purpleColor]; crossButton.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Cross.png"]]; [cell addSubview:crossButton]; cell.textLabel.font =[UIFont systemFontOfSize:13]; cell.textLabel.textColor =[UIColor grayColor]; cell.textLabel.text =[tagArray objectAtIndex:indexPath.row]; [crossButton addTarget:self action:@selector(deleteCell:) forControlEvents:UIControlEventTouchUpInside]; 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.
    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