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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:05:33+00:00 2026-06-17T06:05:33+00:00

In my app I have two screens – first to show a user profile,

  • 0

In my app I have two screens – first to show a user profile, the second – to edit the profile information. They are similar. I have completed the xib file for the first screen.

What’s the best way to reuse it on second screen?

  • 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-17T06:05:34+00:00Added an answer on June 17, 2026 at 6:05 am

    You should encapsulate the related elements as a custom view class. You can tackle this problem by creating views with code instead of just xibs, and I would recommend this.

    But, if you would prefer to use a xib, you can create one that models the stuff you want to reuse. And then in your view controller call some code like this:

    UIView* aView = [UIView alloc] initWithFrame .....];
    [[NSBundle mainBundle] loadNibNamed:@"MyReusableComponent" owner:aView options:nil];
    UILabel* someLabel = aView.injectedLabel; //this is alive after loading the xib
    [self.view addSubView:aView];
    

    When you create your xib, your need to set the Files Owner to a class that will respond to the setters for the properties that will be injected. (Eg your new view class). This way you can wire up the references.

    For more information, look at Apple’s examples of loading table cells from a xib – this is the same technique. When you load a xib and specify the owner, it will inject the values from the xib into the owner, in this case a custom view.

    enter image description here

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

Sidebar

Related Questions

I have two <select> s in my app but on different screens. They have
I have two screens on my app that I want to present to users,
I have two CSS files in my web app: reset.css and screen.css. They appear
In my app I have two different controllers for two different screens of the
I am developing a simple game app. I am required to have two screens
I have an app with two screens, and buttons that switch between them. One
In my iPad app I have two textfields. One displays the normal, default textfield
I have two app icons built-in (free and premium), is it possible to replace
I have an App that I want to have two version in the App
Is it possible to have two app.config files where one app.config serves as a

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.