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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:01:36+00:00 2026-05-21T15:01:36+00:00

how to change two labels one by one with one button -(IBAction)see :(id) sender

  • 0

how to change two labels one by one with one button

-(IBAction)see :(id) sender

{
    labl1.text=[NSString stringWithFormat:@"hi"];

    labl2.text=[NSString stringWithFormat:@"helo"];

}
  • 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-21T15:01:37+00:00Added an answer on May 21, 2026 at 3:01 pm

    Try with below

    Suppose you have two UILabel in memory.

      //Set text
      labl1.text=[NSString stringWithFormat:@"hi"];
      labl2.text=[NSString stringWithFormat:@"helo"];
    
      //Set their frame
      labl1.frame = CGRectMake(x,y,width,height);
      labl2.frame = CGRectMake(x,y,width,height);
    
      ...........
      ...........
    
      //Add to super view 
      [self.view addSubviews:labl1];
      [self.view addSubviews:labl2];
    
    -(IBAction)see :(id) sender
    {
        if(SomeCondition)
        {
          labl1.hidden = NO;
          labl2.hidden = YES;
        }
        else 
        {
          labl2.hidden = NO;
          labl1.hidden = YES;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you change this array: [[1,one], [2,two], [3,three]] to this? [1,one], [2,two], [3,three]
Given the case I made two independent changes in one file: eg. added a
I have two Ext.menu.CheckItem's in a group. How would I change the checked item's
I'm trying to change the appearance of one of the native sectioning commands in
When I click the purchase button for the form I want the buttons text
Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
I have two drop down menus, one of which I am trying to replace
Here are my two reg expressions. The first one seems to match my case
Is there any way to list all the files that have changed between two
I had a problem with committing changes after merging two branches of my project

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.