• 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
Re: Re-using the same NIB on two owners
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re-using the same NIB on two owners


  • Subject: Re: Re-using the same NIB on two owners
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 26 Jun 2011 12:29:10 -0400

On Sun, Jun 26, 2011 at 11:16 AM, Daniel Luis dos Santos
<email@hidden> wrote:
>
> My problem is that I need to load the same NIB from two different classes, so the owner is different according to which class I load it from.
> Is there another way to do it without the file's owner ? Subclassing the controller ?

One way would be to declare a common superclass, of which both owner
classes are subclasses, that implements the outlets & actions that are
connected in the .xib. Each subclass can then override the actions as
needed. In IB (or Xcode 4, as the case may be), just define the
"file's owner" in the .xib as the parent class.

sherm--

--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________

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

References: 
 >Re-using the same NIB on two owners (From: Daniel Luis dos Santos <email@hidden>)

  • Prev by Date: Re-using the same NIB on two owners
  • Next by Date: NSURLConnection
  • Previous by thread: Re-using the same NIB on two owners
  • Next by thread: NSURLConnection
  • Index(es):
    • Date
    • Thread