5

What is the difference between those two? What is Selector, and what is #selector?

enter image description here enter image description here

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
Kyle Bing
  • 179
  • 1
  • 18

1 Answers1

6

Both are same things, the purpose of #selector() syntax is to save you from the possible error in having to write a selector as a literal string, which is error-prone.

Baig
  • 4,737
  • 1
  • 32
  • 47
  • 2
    `Selector()` is old, only fill with String, can't check syntax error, but `#selector` is new, and it works like real class. – Kyle Bing Sep 06 '17 at 10:39