Dynamic binding -- Qt's Signals and Slots vs Objective-C
Bill Baxter
wbaxter at gmail.com
Sat Sep 30 21:44:13 PDT 2006
Hey there,
Fredrik Olsson wrote:
> Bill Baxter skrev:
>> > [obj1 sendAction:[obj1 action] to:[obj1 target]];
>> it looks like there are two methods, 'sendAction' and 'to'.
>> And I take it [obj1 action] is a named attribute lookup, similar to a
>> QProperty?
>>
> Hmm... now this is strange, and it took a while for me to grasp it as
> well :). Lets take this one:
> [obj1 sendAction:[obj1 action] to:[obj1 target]]
> It is actually three method calls, two of them nested.
> [obj1 action] is calling obj1's method action, and that method returns a
> selector, a selector is a method.
> [obj1 target] is also a method call, but returning an object instance.
That's very interesting. Can you also reverse the order of arguments in
the call, like to:sendAction:? Or is that a different method?
[obj1 to:[obj1 target] sendAction:[obj1 action]]
--bb
More information about the Digitalmars-d
mailing list