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

  • Home
  • SEARCH
  • 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 7925327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:14:50+00:00 2026-06-03T18:14:50+00:00

i am new to ios. I have a viewController, where in there is a

  • 0

i am new to ios. I have a viewController, where in there is a notification observer.
For example

-(void) myNotificationObFn:(Notification *)noti
{
  /* Here i am trying to change the text of UILabel, which is not working. 
  ie:
    NSString *ns = [NSString stringWithFormat:@"%d", 10];
    mylabel.text = ns;
  */
}

How can i resolve this issue ?

  • 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-03T18:15:02+00:00Added an answer on June 3, 2026 at 6:15 pm

    try using the tag function if you want to change the label

    examples :

    if you create the label programmatically, set the tag of your label after you create it for the first time

    UILabel *myLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 50)];
    [myLabel setTag:1234];
    

    if you create the label in your XIB or storyboard, just change the “tag” field

    this way, your label get a tag “1234”

    after this, if you need to edit this label , on your notification method put this code

    UILabel *labelfromtag = (UILabel*)[self.view viewWithTag:1234]; //this code direct label "labelfromtag" to your "myLabel", so your new label here is actually your old label
    NSString *ns = [[NSString alloc] initWithFormat:@"%d", 10];
    
    labelfromtag.text = ns;
    

    good luck :]

    edit : also, is this notification reside in the same class / controller as ur UILabel?

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

Sidebar

Related Questions

I'm quite new here. I have a problem with the new iOS 5.1 slide-in
I'm new to iOS development so I'm confused. I have a ViewController, in this
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
First of all I have to say I am new to iOS development. My
I am new to iOS projects. In my current project, I have to process
I am new in ios development .Now i am trying to develop an ipad
i'm just new to iOS Programming, so appreciate for any help. I'm trying to
I am new to iOS development and am trying to figure out how it
I am new to iOS programming. I see that there are functions defined in
I'm fairly new to iOS programming, but have a basic understanding of it. I

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.