• 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: Connecting Outlet on Derived Array Controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connecting Outlet on Derived Array Controller


  • Subject: Re: Connecting Outlet on Derived Array Controller
  • From: Joanna Carter <email@hidden>
  • Date: Mon, 1 Mar 2010 09:44:37 +0000

Hi Ken

> Why do you think that?  What aspect of your design leads you to that conclusion?

I have a one-to-many relationship between two classes but, with a slight twist...

MasterObject 1..n DerivedDetailObject

DerivedDetailObject inherits from BaseDetailObject

BaseDetailObject n..1 MasterObject

So, it is a two-way relationship, split by inheritance on the detail side :-)

> Normally, an outlet would be something that the class inherently uses (or would use if connected).  Since NSArrayController has no already existing need for the outlet you're adding, and doesn't know to use it if it's present and connected, it doesn't make sense to create a subclass solely for the purpose of adding it.

The need for subclassing an array controller is to override the addObject: method to set the "master" property on each object that gets added to the "detail" list.

> You don't bind an outlet, you merely connect it.  And you connect it to an object, not a property of an object.  Your choice of terminology makes me wonder if what you really want to do is create a new binding, which is a different kind of thing from an outlet.

Yup, I do realise there is a difference between outlets and bindings. It's just that I haven't yet discovered how to declare the two sides of a binding, that can be completed in IB.

Unless, of course, there is another way to circumvent the problem of resolving the "split" relationship.

Joanna

--
Joanna Carter
Carter Consulting_______________________________________________

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: Connecting Outlet on Derived Array Controller
      • From: Joanna Carter <email@hidden>
  • Prev by Date: Re: Carbon is C++?
  • Next by Date: Re: action for raise and lower baseline of textview
  • Previous by thread: Re: Carbon is C++?
  • Next by thread: Re: Connecting Outlet on Derived Array Controller
  • Index(es):
    • Date
    • Thread