Re: Sent Actions, Delegates, Outlets

2008-07-24 Thread Chris Hanson
On Jul 24, 2008, at 4:10 AM, Oleg Krupnov wrote: Notifications is another point of confusion for me. I would assume that notifications should be used when multiple observers can be connected to an "event" exposed by an object, in contrast to a simple "delegate" outlet, which can only have one

Re: Sent Actions, Delegates, Outlets

2008-07-24 Thread mmalc crawford
On Jul 23, 2008, at 10:51 PM, Graham Cox wrote: 2) I have found that IB automatically treats all member variables of my custom view's class that are of type "id" or "id<...>" as outlets, i.e. they appear in the list of outlets on Ctrl+click. This is not always desirable. How do I prevent some o

Re: Sent Actions, Delegates, Outlets

2008-07-24 Thread Erik Buck
Warning: Blatant self serving plug: Target/Action, Delegates, and Notifications are all software design patterns. They aren't even unique to Cocoa, but Cocoa has particularly elegant implementations. You can read/review all about these patterns and more including analysis of the m

Re: Sent Actions, Delegates, Outlets

2008-07-24 Thread Oleg Krupnov
>> Notifications is another point of confusion for me. I would assume >> that notifications should be used when multiple observers can be >> connected to an "event" exposed by an object, in contrast to a simple >> "delegate" outlet, which can only have one connected object. Am I >> correct? > > The

Re: Sent Actions, Delegates, Outlets

2008-07-24 Thread Chris Hanson
On Jul 23, 2008, at 11:28 PM, Oleg Krupnov wrote: Notifications is another point of confusion for me. I would assume that notifications should be used when multiple observers can be connected to an "event" exposed by an object, in contrast to a simple "delegate" outlet, which can only have one c

Re: Sent Actions, Delegates, Outlets

2008-07-23 Thread Oleg Krupnov
On Thu, Jul 24, 2008 at 9:15 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > > On 24 Jul 2008, at 3:58 pm, Oleg Krupnov wrote: > >> Currently the "Sent Actions" section does not even appear in my custom >> view's connections menu at all, how would I make it appear? > > > To clarify: the reason it's not

Re: Sent Actions, Delegates, Outlets

2008-07-23 Thread Graham Cox
On 24 Jul 2008, at 3:58 pm, Oleg Krupnov wrote: Currently the "Sent Actions" section does not even appear in my custom view's connections menu at all, how would I make it appear? To clarify: the reason it's not listed is because the built-in support is for NSControl and its subclasses. If

Re: Sent Actions, Delegates, Outlets

2008-07-23 Thread Graham Cox
On 24 Jul 2008, at 3:58 pm, Oleg Krupnov wrote: target/action Is this the same as the following? action is sent to target on a click. The other things you mention are either not detected or not sent on to the target. I don't quite understand how target/action works under the hood. If I

Re: Sent Actions, Delegates, Outlets

2008-07-23 Thread Oleg Krupnov
> target/action Is this the same as the following? > action is sent to target on a click. The other things you mention are either > not detected or not sent on to the target. I don't quite understand how target/action works under the hood. If I were an implementor of NSButton, how would I declar

Re: Sent Actions, Delegates, Outlets

2008-07-23 Thread Graham Cox
On 24 Jul 2008, at 3:34 pm, Oleg Krupnov wrote: I'm building a custom view 1) What is the recommended way of raising external "events" (at least that's what they were called in C#) from within a custom view, in order to trigger actions in other objects that may be observing the view? I assume

Sent Actions, Delegates, Outlets

2008-07-23 Thread Oleg Krupnov
I'm building a custom view 1) What is the recommended way of raising external "events" (at least that's what they were called in C#) from within a custom view, in order to trigger actions in other objects that may be observing the view? I assume it is to use a delegate outlet, right? However I no