Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7688547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:56:47+00:00 2026-05-31T19:56:47+00:00

I want to place UItextField in UITableViewCell but I have problem. Text field don’t

  • 0

I want to place UItextField in UITableViewCell but I have problem. Text field don’t appear. This is my code:

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString         *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.textField = [[UITextField alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 120.0f, 45.0f)];
        self.textField.textColor = [UIColor blackColor];

        [self.contentView addSubview:self.textField];
    }

    return self;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    TextFieldCell *cell = (TextFieldCell*)[tableView  dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[TextFieldCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    switch (indexPath.row) {
        case 1:
            cell.textField.placeholder = @"Username";
            break;
        case 2:
            cell.textField.placeholder = @"Password";
            break;
        case 3:
            cell.textField.placeholder = @"Server Address";
            break;
        case 4:
            cell.textField.placeholder = @"Description";
            break;            
        default:
            break;
    }

    return cell;
}

I test and initWithStyle method is called.Can someone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:56:48+00:00Added an answer on May 31, 2026 at 7:56 pm

    IF you have .xib file for TextFieldCell then drag and drop textview and set all properties form Interface builder else
    you can create only *.XIB to use as TableViewCell by*

    In .h file

    IBOutlet UITableViewCell* CUSTOM_CELL_XIB;

    In .m file in cellForRowAtIndexPath method

    static NSString *CellIdentifier = @"Cell";
    
    
    UITableViewCell *cell = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (cell == nil) 
    {
        [[NSBundle mainBundle] loadNibNamed:@"CUSTOM_CELL_XIB" owner:self options:nil]; 
        cell = CUSTOM_CELL_XIB;
    }
    

    and directly drag and drop textField or whatever UI you want, I think it is efficient way for custom cell creation.

    This will perfectly work

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this image: But i want to place text in the middle like
I have a UITextField which I created programmatically. This text field is used to
Possible Duplicate: Iphone UITextField only integer I want to place a text field that
I want to place an image beside a text like this: <div class=views>text<img src=...></img></div>
i have a uitextfield and i am validating text field and the validation is
I want place ads in my website, but I'm unsure about the common practices
I want to place this UserControl at Canvas.Left=168, Canvas.Top=213. However, the control appears at
I want to place a table on my page. I have two tables in
I want to format any text that is placed into a NSTextField/UITextField to look
I have a strange problem with UITableView and UITextField inside the cell (as subview).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.