Il giorno 30/ago/07, alle ore 20:45, Frank Bettger ha scritto:
But where are the instance variables target and action?
Directly accessing variables is usually a no-no in Cocoa; not because
it's impossible, but because it makes for poor encapsulation (for
example, it may be changed by anyone at any time, and you for example
would not be able to retain the new value or release the old one).
Virtually all access is done via properties, which are pairs of -
someValue/-setSomeValue: methods. Interface Builder should set the
action *property*, which means calling -setAction: on the button.
(See also the Cocoa docs on Key-Value Coding for more.)