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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:51:06+00:00 2026-06-14T10:51:06+00:00

I have defined a label in my viewController and I also set its @property

  • 0

I have defined a label in my viewController and I also set its @property and synthesized it. I have establish link between between file owner and UIlabel in viewDidLoad. I am trying to display this string link:

- (void)viewDidLoad {
    getname = [[UILabel alloc] init];
    getname.text = @"hello";
    [super viewDidLoad];
}

But the string is not displaying on the label on the UIView. Please tell me what I need to do to display a string on a UIView. The view controller and nib file has the same names.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

But when I added viewcontroller.m file want to display something on view, it does not response to that code. How can I fix this?

  • 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-14T10:51:07+00:00Added an answer on June 14, 2026 at 10:51 am

    Just replace this function this code

    - (void)viewDidLoad
    {
    
        getname = [[UILabel alloc] init];
    
    
        getname.text = @"hello";
    
        [self.view addSubview:getname];
    
        [super viewDidLoad];
    
    }
    

    Hope it helps you..

    Also if you are using IBOutlet in your .h file, don’t allocate memory to it as it automatically allocates memory.

    So if you have used IBOutlet then your function should be

    - (void)viewDidLoad
    {
    
        getname.text = @"hello";
    
        [super viewDidLoad];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UILabel in my class header file defined as : `@property (nonatomic,
I have a form element defined as: <div class=field> <div class=name> <label for=User_LastName> Last
I have this defined in an existing CSS sheet that I'm working with: label.error-field
I have a tree defined like, struct tree { char label[MAX_LENGTH]; char value[MAX_LENGTH]; struct
I have an activity defined thus: [Activity (Label = MyActivity)] [IntentFilter (new[]{Intent.ActionView}, Categories=new[]{Intent.CategoryDefault, Intent.CategoryBrowsable},
I have an EditText displaying a user defined text label. It displays as blue
I have defined the WPF label with content=Label_Label . While displaying it shows LabelLabel
I have a defined set of seven different post types and would like to
I have a set of UIButtons (defined in a xib) who have labels that
I have defined a set of radio buttons in HTML in a form as

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.