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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:28:37+00:00 2026-06-05T00:28:37+00:00

Is the loading order of top level objects in a nib file random or

  • 0

Is the loading order of top level objects in a nib file random or can it be determined? I thought it would load the objects in the order I put them in in Interface Builder. But that doesn’t seem to always be the case.

I wanted to create an inspector view similar to Interface Builder, where the different sections have alternating background colors. I planned to do this by ordering the sections as top level views in my nib and then color them according to the loading order.

  • 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-05T00:28:38+00:00Added an answer on June 5, 2026 at 12:28 am

    According to the documentation, the loading order is undefined:

    The order in which the nib-loading code calls the awakeFromNib methods of objects is not guaranteed. In OS X, Cocoa tries to call the awakeFromNib method of File’s Owner last but does not guarantee that behavior. If you need to configure the objects in your nib file further at load time, the most appropriate time to do so is after your nib-loading call returns. At that point, all of the objects are created, initialized, and ready for use.

    See https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html

    And regardless, relying on something like the loading order to determine the visual layout seems like a very non-robust idea. I would instead use an NSTableView / UITableView, which will do the layout, alternating row colors, etc. all for you. (On Mac, you probably want a view-based table view). If you need a custom solution for some reason, load and add the views dynamically in code where you have full control over their order and position in the parent.

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

Sidebar

Related Questions

After loading a PHP template (using jQuery's load function), this simple script won't make
while loading getfptex(got it from CTAN) batch file ,when i'm extracting this batch file
I want to know the order of loading the CSS files in a HTML
in order to increase my site's loading times and as a nice addition, I
Working in C, on top of unix, I am loading and using a shared
I'm displaying some icons (annotations) on a map in my app by loading them
I have a grid and when i change its sorting order i a loading
i'd like to have a leading zero in a spinbutton in order to always
Loading images into Flex (size < 100kb) causes IE7 memory increase by a megabyte
Error loading script occurs under FireFox 3 if I quickly click different links on

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.