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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:36:18+00:00 2026-05-17T19:36:18+00:00

In my app I have a custom UIView subclass (let’s call it MyView) which

  • 0

In my app I have a custom UIView subclass (let’s call it MyView) which contains three buttons and two labels. I add this view to a view controller which also has a table view (I add the instance of MyView at the bottom).

Because of the business logic rules, the labels and one button out of three are hidden in the beginning. So I do this in viewDidLoad:

self.myView.label1.hidden = YES;
self.myView.label2.hidden = YES;
self.myView.button1.hidden = YES;

which works fine. So these three are hidden and the remaining two buttons are visible.

Now this view controller is also a delegate for another class. At some point in time an event occurs in this other class which calls a notification method in my view controller.

In this notification method I have now to show the hidden controls. So I obviously tried the following:

self.myView.label1.hidden = NO;
self.myView.label2.hidden = NO;
self.myView.button1.hidden = NO;

but it doesn’t work, they don’t appear.

Any idea what I’m doing wrong? Do I need to somehow “repaint” self.myView after this so that the controls become visible? What am I missing here?

Many thanks in advance!

Edit

I have added some NSLogs after setting them visible and the logs show something like this:

label1.hidden = 0
label2.hidden = 0
button1.hidden = 0

So as per the logs, they should be visible.

  • 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-17T19:36:18+00:00Added an answer on May 17, 2026 at 7:36 pm

    Ok, so I solved the problem. I moved the code that sets the visibility of the controls in another method and I call this method like this:

    [self performSelectorOnMainThread:@selector(updateControls) withObject:nil waitUntilDone:NO];
    

    So what do you know, the notification method was called in another thread (I didn’t know this, the library I am using is actually not mine and there’s nothing in the docs about this fact).

    Anyway, it’s nice that it works now.

    Thanks all!

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

Sidebar

Related Questions

I have this app of mine that contains a section that will allow the
I have implemented a custom UITableViewCell which includes a UITextView that auto-resizes as the
I have an App I have updated with some .Net4 assemblies, including the custom
I have subclassed UIView and created a NIB that controls the main logic for
I have custom redirection implemented in a module. Do I have to modify each
i have this app that i developed and it works great on the simulator
We are migrating to Winforms to WPF based solution. We have custom XML definition
so i am using presentmodalviewcontroller to change the active views in an ipad app.
I'm aware some of you may not be familiar with Monotouch, but this could

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.