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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:07:10+00:00 2026-06-10T22:07:10+00:00

This is how I use a XIB view controllers view as a subview in

  • 0

This is how I use a XIB view controllers view as a subview in the MainViewController:

UIViewController *nameController = [[NameSubViewController alloc] initWithNibName:@"NameSubViewController" bundle:nil];
nameSubView = [nameController view];
[self.view addSubview:nameSubView];

The nameController view contains a UITextField property. Can I somehow access this property from MainViewController?

EDIT:

If I create a property for the textField in the View Controller too, I’m still not able to get it in MainViewController. Think it’s because of the UIView subclassed causing problems?

NameSubViewController.h:

#import <UIKit/UIKit.h>

@interface NameSubViewController : UIViewController

@property (nonatomic, strong) IBOutlet UITextField *textField;

@end

NameSubView.h:

#import <UIKit/UIKit.h>

@interface NameSubView : UIView

@property (nonatomic, strong) IBOutlet UITextField *textField;

- (IBAction)textFieldReturn:(id)sender;

@end

Connections in IB for NameSubViewController:

Connections, NameSubViewController

Connections in IB for NameSubView:

Connections, NameSubView

  • 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-10T22:07:12+00:00Added an answer on June 10, 2026 at 10:07 pm

    Did you create an outlet for the textfield in your nameController? Do that, and then you can retrieve the value using

    nameController.textField.text
    

    In the nib file, click on the file’s owner icon (on the left of the nib), and set it’s class to your UIView’s subclass using the inspector on the right.

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

Sidebar

Related Questions

When I use an .xib, I connect a view's delegate to the File's Owner
Is it a best practice to use more than one xib in a view
From my viewcontroller view I am loading a xib file. I want this view
I have a UIView as a XIB in Portrait mode. This view is added
I am adding a XIB as a subview just for a temporary use. It
I have this use case of an xml file with input like Input: <abc
When I run this: use feature ':5.10'; $x=1; given ($x) { when(1) { say
I'm having a misunderstanding problem with this use of Linq Query I do have
I am doing pass-by-reference like this: use strict; use warnings; sub repl { local
I would like to change this: // use appropiate lang.xx.php file according to the

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.