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 8923247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:04:13+00:00 2026-06-15T07:04:13+00:00

I am experimenting with putting a UITextField inside a UITableViewCell . Now I got

  • 0

I am experimenting with putting a UITextField inside a UITableViewCell.

Now I got two working methods.

Using addSubview method:

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"textFieldCell"];

UITextField *textFieldView = [[UITextField alloc] initWithFrame:CGRectMake(150, 7, 150, 30)];
[textFieldView setPlaceholder:@"Placeholder"];

[cell addSubview:textFieldView];

Using setAccessoryView method:

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"textFieldCell"];

UITextField *textFieldView = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150, 30)];
[textFieldView setPlaceholder:@"Placeholder"];

[cell setAccessoryView:textFieldView];

In my opinion the setAccessoryView result is better looking, since the alignment is done automatically.

But my question is: It it ok to put a UITextField inside a AccessoryView? Or is there a good reason why I shouldn’t do it that way?

  • 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-06-15T07:04:19+00:00Added an answer on June 15, 2026 at 7:04 am

    There is no any restriction on it by apple, but main intention to add accessoryView property in UITableViewCell class, to be used, typically as a control, on the right side of the cell (normal state).

    Following sentence taken from the apple document:

    If the value of this property is not nil, the UITableViewCell class uses the given view for the accessory view in the table view’s normal (default) enter code herestate; it ignores the value of the accessoryType property. The provided accessory view can be a framework-provided control or label or a custom view. The accessory view appears in the right side of the cell.

    According to this statement you can provideUITextField (framework-provided control) as accessoryView.

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

Sidebar

Related Questions

Experimenting with Swing, I learnt that there are two ways of using JOptionPane and
Experimenting with android game development. I'm using PNG format for images, and was wondering
I'm experimenting with ASP.Net Web API, which, by convention, splits controller methods into a
I was just experimenting and tried putting this in the console: 4 | 2
been experimenting with unordered list UL and i have seem varios examples of using
I'm using devExpress 11.1 with MVC 3/razor and i'm experiencing problems with putting html
I'm experimenting with putting an HTML/CSS/Javascript based drop down menu in my website. I
Experimenting using different approaches and reducing code maintenance I have ended up using reflection
experimenting with Visitor pattern and generic method I found a kind of discrepancy in
I'm experimenting using the xmlgen library to generate some relatively simple xmd documents; however,

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.