IBScrollViewFloatingHeader icon indicating copy to clipboard operation
IBScrollViewFloatingHeader copied to clipboard

-[UIScrollView floatingHeaderView]: unrecognized selector sent to instance

Open alekop opened this issue 6 years ago • 2 comments

This is probably a dumb noob question, but I'm getting an unrecognized selector when calling from Swift.

myScrollView?.floatingHeader = headerView.

Also tried explicitly getting the selector: myScrollView.perform(#selector(setter: UIScrollView.floatingHeaderView), with: headerView). Same result. What am I doing wrong?

alekop avatar Oct 16 '18 18:10 alekop

In LLDB, I can get the selector:

(lldb) p #selector(setter:(myScrollView.floatingHeaderView)) (Selector) $R0 = "setFloatingHeaderView:"

But...

(lldb) p myScrollView.perform(#selector(setter:(myScrollView.floatingHeaderView)), with: headerView) 2018-10-16 12:22:08.598233-0700 myapp[47655:11222566] -[UIScrollView setFloatingHeaderView:]: unrecognized selector sent to instance 0x7fe4a98e4600

alekop avatar Oct 16 '18 19:10 alekop

I don't know what the problem was, but I ported the code to Swift, and that worked.

alekop avatar Oct 17 '18 01:10 alekop