• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Swapping IB-created views and keeping IBOutlets hooked up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Swapping IB-created views and keeping IBOutlets hooked up


  • Subject: Swapping IB-created views and keeping IBOutlets hooked up
  • From: Alex Kac <email@hidden>
  • Date: Tue, 16 Sep 2008 17:33:38 -0500

I have two views that are different layouts of the same UI loaded by a NSViewController. Now lets say that I have an IBOutlet to an NSButton* button1 that is present in both views. I want to swap one view out for the other and when I do so have the IBOutlet for button1 swap to the button1 defined in the second view in another NIB.

So for example, the viewcontroller inits with View A. button1 is assigned to the NSButton in View A. I then swap that view to View B which also have a button1. View B is in a different NIB. So I want button1 to now point to View B. Is this something that can be done automatically?

One way I was thinking of doing this was as follows:

IBOutlet NSButton* button1_viewA;
IBOutlet NSButton* button1_viewB;
IBOutlet NSButton* button1;

and then point button1 to whatever is the currently displayed view. That's fine and doable, but before I do that I wanted to know if there was a better way, a more manageable way.

Thanks!

Alex Kac - President and Founder
Web Information Solutions, Inc.

"If at first you don't succeed, skydiving is not for you."
-- Francis Roberts





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Swapping IB-created views and keeping IBOutlets hooked up
      • From: Jonathan Hess <email@hidden>
    • Re: Swapping IB-created views and keeping IBOutlets hooked up
      • From: Ken Thomases <email@hidden>
    • Re: Swapping IB-created views and keeping IBOutlets hooked up
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Core Data and ordered relationships
  • Next by Date: Re: Drawing on Another App's CGDisplayCapture
  • Previous by thread: Re: How to uniquely determine MD5-sum of a dict?
  • Next by thread: Re: Swapping IB-created views and keeping IBOutlets hooked up
  • Index(es):
    • Date
    • Thread