Delegate and IBAction

They seem to do the same thing in Objective C. What can you do without the other?

+4
source share
1 answer

For instance:

  • Delegate methods can have return values.
  • There can be several purposes for the same action, but usually only one delegate.
  • The mechanism of the target action (semantically, but not strictly) is associated with predetermined control events, such as โ€œchange in valueโ€, โ€œtouchโ€, etc. Delegation methods can be any.
  • Delegate methods can have arbitrary arguments. Action methods always have the same arguments (sender and event, both optional).
+3
source

All Articles