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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:54:59+00:00 2026-06-18T03:54:59+00:00

How would I go about changing the a UILabel property in another view controller?

  • 0

How would I go about changing the a UILabel property in another view controller?

I have #import "SecondViewController.h" imported in the FirstViewController.m file and then

I have the following in a method in FirstViewController

-(IBAction) someAction {

    SecondViewController *objV1 = [[SecondViewController alloc]init];

    objV1.secondViewControllerLabel.alpha = 0.2;

NSLog(@"someAction");

}

when someAction is called nothing happens to the UILabel in the SecondViewController.

also, in this example both first and second view controllers are in another view controller called MainViewController. So, they are both onscreen at the same time.

thanks for any help.

  • 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-18T03:55:00+00:00Added an answer on June 18, 2026 at 3:55 am

    From what you tell us, it would seem that you need to set the “embeded view controllers” as childs of the parent View Controller.

    [mainViewController addChildViewController:childViewController];
    [childViewController.view setFrame:self.view.bounds];
    [self.childContainerView addSubview:childViewController.view];
    [childViewController didMoveToParentViewController:self];
    

    This is very powerful, because you can forward IBActions from the mainViewController to their child…

    [mainViewController childViewControllers]
    

    Returns an array of them, and also take a look at

    – shouldAutomaticallyForwardRotationMethods
    – shouldAutomaticallyForwardAppearanceMethods
    

    So your child get automatically informed about the rotations of their parent.

    To answer your question, you could do something like:

    // In Parent View Controller
    - (IBAction) anAction:(id) sender
    {
        for (CustomChildController *child in self.viewControllers) {
            [child handleSomeAction];
        }
    }
    

    Check out what the docs say for more details.

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

Sidebar

Related Questions

Does anyone know how I would go about changing (transforming) an image based on
Anyone have any idea how I would go about converting a timestamp in milliseconds
I was wondering how i would go about changing image.src in the javascript without
How would I go about changing a Wordpress user's password directly in the database?
I was wondering how one would go about changing the first digit (0-9) that
How would I go about changing the decimals and length attributes of a float
How would I go about changing points that are 'near' linear (within a threshold),
How would i go about changing just the HTML of this: <div class=name>President Speech</div>
How would I go about changing to code to eliminate the textbox that takes
Using the WCF Web API how would I go about changing a response's content

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.