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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:03:49+00:00 2026-05-12T18:03:49+00:00

As I move more and more of my UI construction from XCode to IB

  • 0

As I move more and more of my UI construction from XCode to IB there is one remaining hurdle I need to clear.

Currently, I create my custom viewControllers in XCode with custom initializers. They typically have a bunch of ivars that are set during initialization via passed params. I would really like to move as much of this as I can to IB.

Could someone carefully explain to me – or, better, point me to code – how to replicate the XCode approach of passing params via custom initializer in IB – presumably via IBOutlet.

Thanks in advance.

Cheers,
Doug

UPDATE:

A typical scenerio is my AppDelegate will go out to the network, grab some data – NSMutableData, and then pass a reference to a root viewController – typically a TableViewController – that is pushed on the viewController stack of an navigationController.

When a cell is selected an secondViewController is alloc/init’ed and a subset of the data is passed to it. The secondViewController goes to the network for a bit more data, builds a view hierarchy, hands bits of the retrieved data to each subview and then each subview is messaged with setNeedsDisplay to process the data.

It is this hierarchical data passing that I want to hand off to IB is possible.

  • 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-12T18:03:50+00:00Added an answer on May 12, 2026 at 6:03 pm

    You can still have a custom initializer. However, inside this initialized you’ll call -[initWithNibName:@"yourNibName" bundle:bundle]. You will connect your UIKit related instance variables (UILabel, UIButton, etc.) in Interface builder and therefore won’t have to instantiate those objects in your initializer. Other instance variables (strings, dictionaries, custom objects, etc.) you’ll instantiate and set in your initializer.

    Also, keep in mind that manipulation of your UIKit related variables such as setting label text, or setting the position of a UIView, should be done in the viewDidLoad method since these objects may not have been fully created at the time initializer is executing.

    Let me know if you need more information.

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

Sidebar

Related Questions

I would like to move more than one item from one list to another.
I am starting to move more of my view hierarchy construction to IB. I
I want to create a custom control derived from TPanel that contains an image
My understanding of constructor chaining is that , when there are more than one
I come from a mostly n-tier background, and I'm trying to move more towards
How can this be done more elegant and without creating new objects? List<Move> playerMoves
How to move the dropdown box to align exactly under the news tab.? Currently
I'm trying to move my APN backoffice from PHP to C# for performance issue.
I usually don't need to ask Java questions, but I'm stuck more than ever
I'm trying to make a SeekBar move more smoothly than just jumping straight to

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.