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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:40:37+00:00 2026-05-25T06:40:37+00:00

I have written a simple contact manager application that uses a UITableView to display

  • 0

I have written a simple contact manager application that uses a UITableView to display the contacts. Each contact is shown as a standard UITableViewCell; custom content is created as UIButtons and UILabels that are added as subviews of the cell’s contentView. My table viewController's cellForRowAtIndexPath method includes:

UIButton *emailButton;
UITableViewCell *cell = 
        [theTableView dequeueReusableCellWithIdentifier:@"My Identifier"];
if (cell == nil) 
   {
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                    reuseIdentifier:identifier] autorelease];
     emailButton = [UIButton buttonWithType:UIButtonTypeCustom];
     [emailButton setImage:emailImage forState:UIControlStateNormal];
     emailButton.tag = EMAIL_BUTTON_TAG;
     emailButton.frame = emailButtonFrame;
     [cell.contentView addSubview:emailButton];
   } else {
     emailButton = (UIButton *)[cell viewWithTag:EMAIL_BUTTON_TAG];
   }
... set various attributes of the cell, including the content of custom labels
... added as subviews of the contentView exactly as above

This works fine when rendering my table. But I’ve also added a search bar to my app, set the search bar’s controller appropriately, and set the controller's delegate back to this same tableController such that the exact same cellForRowAtIndexPath method is called when performing the searches, and of course I filter the set of cells to be displayed to match the query.

What I see is that when I perform a search, all of the content that I display by setting cell.textLabel.text or cell.imageView.image shows up perfectly in the table, but the emailButton or the labels that I added as subviews of the cell’s contentView don’t appear. In the debugger, I can clearly see that these controls (the buttons and labels) exist at the time that cellForRowAtIndexPath is called while search filtering is going on. But the controls don’t render.

I feel there must be something very subtle in the interactions between table cells and the searchView, but I’m missing it.

  • 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-25T06:40:38+00:00Added an answer on May 25, 2026 at 6:40 am

    Setting the textLabel’s text property appears to also bring the textLabel to the front. Even though the text label does not appear to overlap with any of the content view’s buttons, this is causing the buttons to disappear. Forcing them to the front after the textLabel is updated makes the problem go away.

    It is not clear why this behavior is only appearing in the search case and not in the normal case, but I was able to reproduce it in a simple change to the iOS “TableSearch” example.

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

Sidebar

Related Questions

I have written a simple application that displays a list of candidates for a
I have written a simple WCF service that accepts and stores messages. It works
I have written a very simple WCF service, that worked fine (code below), then
I have written a simple WPF application in which I wanted to test the
I have written a simple feedback application in django. It's not particulairly complex, basically
I have written a simple erlang app using gen_server. When starting it with application:start(myapp),
I have written a simple jQuery script that changes the hash tag of a
I have written a simple test application using asp.net mvc with C#. The application
I have written simple lexical analyzer. And I understand the need to provide each
I have written a simple program that does autocorrelation as follows...I've used pgi accelerator

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.