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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:43:57+00:00 2026-06-04T23:43:57+00:00

If I can load an object from a nib file without using file’s owner

  • 0

If I can load an object from a nib file without using file’s owner then what is the reason of existence of file’s owner? Also the outlet-action connections can be created without the use of file’s owner. For example i can make the connections directly from the object to the nib. So again i really can’t understand the need for file’s owner. Does it have any relation with MVC pattern? Does file’s owner must be of UIViewController type?

  • 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-04T23:44:00+00:00Added an answer on June 4, 2026 at 11:44 pm

    During the loading of a nib file, Cocoa generates each object serialized in the nib file. Then, for each connection in the nib file, it calls setValue:forKey: on the target object to create the connection. Some connections are to the object nil. Those setValue:forKey: messages are sent to whatever object is passed as the file owner.

    If you have no file owner, then the nil connections will be ignored. If you have no nil connections, then it would be no different than not having a file owner. This is not particularly common.

    All of this allows you to instantiate multiple instances of the same nib file objects, by passing different file owners to to the loading process.


    EDIT:

    Remember, a nib file is just a bunch of serialized objects. When you programmatically create a view controller with initWithNibName:bundle:, the view controller already exists before the nib file is loaded. The objects inside the nib file almost always want to be able to refer to that view controller. So we pass the view controller to UINib as the file owner. Anywhere the nib file says nil, UINib replaces that with the file owner (typically the view controller).

    This is very flexible, but flexibility isn’t the point. There’d be no way to refer to the view controller inside the nib file if you didn’t pass it in during nib instantiation.

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

Sidebar

Related Questions

Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader :
Is there a way that i can load the file from url, not from
I'm using TinyXml library for my application but TiXmlDocument object just only can load
Consider this typical disconnected scenario: load a Customer object from SQL Server using LINQ
I have a NIB file that I load using NSWindowController initWindowNibName. The NIB file
How can a get a object variable from a remote XML file, for example
how can I load an html page inside a div. With the 'object' tag
Why should we add an object name to a QObject? I can still load
in controller scrollView.autoresizesSubviews = YES; in viewDidLoad of controller I load view object from
I found I could generate XDocument object from html by using SgmlReader.SL. https://bitbucket.org/neuecc/sgmlreader.sl/ 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.