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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:30:05+00:00 2026-05-27T18:30:05+00:00

I’m trying to initialize the values inside a view (created inside a nib file)

  • 0

I’m trying to initialize the values inside a view (created inside a nib file) programmatically.
I’ll try to do a little briefing of my scenario:

I’ve got a nib file, with a view inside. This view has some items (TextViews, CheckBox, etc)

This view is pretended to be a template of the inclusion of new data to my program (it’s not the main view). Here is the view’s windows initialization:

NewWindow = [[NSWindow alloc] initWithContentRect:frame
                                        styleMask:( NSBorderlessWindowMask| NSClosableWindowMask | NSTitledWindowMask) 
                                          backing:NSBackingStoreBuffered
                                            defer:NO];
[NewWindow setIsVisible:NO];
[NewWindow setReleasedWhenClosed:NO];
[NewWindow setBackgroundColor:[NSColor windowBackgroundColor]];
[NewWindow setContentView: MyView];
[NewWindow setDelegate:self];

I call the windows making it visible.

MyView is a IBOutlet connect to the nib’s view. This view is a modified NSView, and it got it’s own class file.

Everything on the view (IBOutlets) is connected and working properly (I know because when, for example, I click a button, the action related to it work just fine).

I created a initialization method on MyViews class, to initialize the template’s fields according to my needs. I call the initialize like this:

[MyView initialize:InitClass];

My problem I’m facing is, this MyView object is not the same as the one inside the nib file, even with all connections (IBOutlets) connected. Then, when I run this method, nothing happens (as the initialize method is trying to change the value of unallocated fields).

I have included some NSLog to see my objects address, and confirmed that the one on the nib file is not the same as the one on the IBOutlet

I’m creating this IBOutlet property like this:

@property (assign) IBOutlet MyNewView *MyView;

Does anyone knows how to solve this problem?

  • 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-27T18:30:06+00:00Added an answer on May 27, 2026 at 6:30 pm
    1. You should never call viewWillMoveToWindow:. It’s an information lifetime event.

    2. It doesn’t seem like you’re showing enough code. I don’t see any evidence that you’re loading the nib. Naturally if you instantiate the MyView by calling [[MyView alloc] init] or similar, that’s a different MyView. If you want your outlet to point to the one in the nib you need to load the nib with yourself as owner.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.