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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:26:40+00:00 2026-05-27T19:26:40+00:00

I have my app that have some tab’s (tabbar). In the first tab, there

  • 0

I have my app that have some tab’s (tabbar).

In the first tab, there are UILabel’s, and on the third tab, there is methods, linked to buttons.

I want to change the value of the UILabel’s from the methods of the third button (launched trough those buttons)

Here is some code to illustrate all that :

FIRST PAGE (with UILabels)
@implementation FirstViewController

// definition des accesseurs
@synthesize details;
@synthesize recapitulatif;

...

And the method that will change the UILabels (SECOND PAGE WIHT BUTTONS – with the actual functions, don’t pay attention to those methods 😉 )

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    [connection release];

    NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    [responseData release];
    //NSString *responseString2 = [NSString stringWithFormat:@"%s%@%s", "[", responseString, "]"]; // Pour ajouter les [] si y'en a pas autour de tout le contenu JSON, et on doit utiliser responseString2 au lieu de responseString à la ligne ci-dessous
    NSArray *tableau = [responseString JSONValue];
    [responseString release];
    NSDictionary *dico = [tableau objectAtIndex:0];//NSDictionary *dico = [responseString JSONValue]; // sans [], on aurait fais ceci!

    // Si cette condition est vérifiée, c'est que le token est recu. On vas alors relancer une requete pour avoir les données.
    if ([dico objectForKey:@"token"]) {
        [ [MySingleton sharedMySingleton] setAuth:[dico objectForKey:@"token"] ];

        //affichage du message de confirmation de sauvegarde des mots de passe
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login et Mot de passe" message:@"Votre login et votre mot de passe sont enregistrés." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];
        [alert autorelease];
    }
}

Thanks for your reading / 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-05-27T19:26:41+00:00Added an answer on May 27, 2026 at 7:26 pm

    Add an observer :

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(updateLabel:)
                                                 name:@"LABELUPDATENOTIFICATION"
                                               object:nil];
    

    in the class where the label exists i.e. 1st tab.

    When the methods of the third button (launched trough those buttons) is invoked post a notification with updated text (NSString) object.

    [[NSNotificationCenter defaultCenter] postNotificationName:@"LABELUPDATENOTIFICATION"
                                                        object:updatedStringLabelText] 
    

    Implement the following notification method in the class having the labels.

    - (void)updateLabel:(NSNotification*)notification
    {
        NSString *updatedText = (NSString*)[notification object];
        [yourLabel setText:updatedText];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that plays some background music, when a certain button is
I have an app that has some configuration settings stored in SharedPreference. Now I
I have an app that downloads some documents from a server and saves them
I have a small app that downloads some files from a remote (HTTP) server
I have an app that needs to process some packets from a UDP broadcast,
I have an app that can open up some other forms at the user's
I have C# MVC web app that has some textboxes that in IE9 you
I have an app that creates a database and do some stuff. I am
I have an app that, after some clicking, shows activity with news contents. I
I have an app that can make modify images. In some cases, this makes

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.