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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:10:04+00:00 2026-05-28T06:10:04+00:00

I created a generic nib file MyGenericView.xib which owner (for reusability purposes) is UIViewController.

  • 0

I created a generic nib file “MyGenericView.xib” which owner (for reusability purposes) is UIViewController.

In my classes I can successfully load the view

[[NSBundle mainBundle] loadNibNamed:@"MyGenericView" owner:self options:nil];

However, I have defined a label as sub-object in the same Generic View.
How can I access it and overload (for example) label.text?

In a normal situation, I would set the file Owner of my Nib to my specific Controller, and connect an IBOutlet to the file owner.
As the file owner (in my generic case) is UIViewController, this it is not possible.

Thanks in advance

  • 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-28T06:10:04+00:00Added an answer on May 28, 2026 at 6:10 am

    In the interface builder, set the label’s tag to, let’s say, 1. You can find the tag field in the attributes inspector, View section. Then use viewWithTag: method:

    // given that the label we seek is in the self.view hierarchy
    //if not, change accordingly
    UILabel* myLabel = (UILabel*)[self.view viewWithTag:1];
    

    Additionally, if you ever happen to have the similar problem with table cells, I recommend using UINib class. This class is great when you don’t need to delegate any actions to the file owner, you can instantiate your objects without any owner at all.

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

Sidebar

Related Questions

How to create a generic method which can call overloaded methods? I tried but
I've created a generic 'SocketServer' class in java which takes the following arguments: String
I have created a container for generic, weak-type data which is accessible through the
When I create a UIViewController in Xcode I can decide to add a nib
We've created a generic method like so: public TReturnType GetValue(string key) { var configurationParameter
I recently created a generic Matrix<T> class that acts as a wrapper around a
I've created a web service that uses a generic type Response<TCode, TData> and so
Fun with enums in C#. Take one generic list that is created to store
I'm trying to create a generic graphics export tool which works by implementing the
I created a generic vector: typedef struct vector_t { int max; /* max number

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.