• 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: Multiple Instances with Multiple Connections in IB - how to?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Instances with Multiple Connections in IB - how to?


  • Subject: Re: Multiple Instances with Multiple Connections in IB - how to?
  • From: Peter Teeson <email@hidden>
  • Date: Thu, 25 Oct 2012 10:32:51 -0400

On 2012-10-24, at 11:03 PM, Quincey Morris wrote:
On Oct 24, 2012, at 18:59 , Peter Teeson <email@hidden> wrote:
But what I would like to achieve is that the IBAction targets both instances so the new colour is set for both of them.

I suppose I could make a method in the Document class akin to the one I used to set the isPushed ivar in my sub-class.
But then why bother with an IBAction.  

Perhaps it is not allowed to have an Action that Targets multiple instances. Or perhaps my understanding is flawed.

The "received" action in IB is something of a fiction -- the color well is the initiator of the action, and it can have only one target. (In the old days, IIRC, you would have had to drag *from* the color well to the target view.)

If you chose to use 2 color wells, you should be able to connect one to each custom view. If you want a single color well to affect both, then you need to target your action to something shared, i.e. a controller, which knows how to set each of the custom views' color. Depending on the structure of your window, it might make sense to send the action to the window controller, or a view controller, or some other object.

In other words, rather than thinking of two custom views being forced to the same underlying color, think of them as *using* a single color property of … something. Probably the window controller, unless you have a better choice.
Yes thanks. That is what I concluded above     "make a method in the Document class"

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Multiple Instances with Multiple Connections in IB - how to? (From: Peter Teeson <email@hidden>)
 >Re: Multiple Instances with Multiple Connections in IB - how to? (From: Quincey Morris <email@hidden>)
 >Re: Multiple Instances with Multiple Connections in IB - how to? (From: Peter Teeson <email@hidden>)
 >Re: Multiple Instances with Multiple Connections in IB - how to? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Reverting to previous version after autosave?
  • Next by Date: Re: Code signing confusion
  • Previous by thread: Re: Multiple Instances with Multiple Connections in IB - how to?
  • Next by thread: lldb equivalent to gdb 'set pathname-substitutions'?
  • Index(es):
    • Date
    • Thread