bryankeller / BLKFlexibleHeightBar

Create condensing header bars like those seen in the Facebook, Square Cash, and Safari iOS apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BLKDelegateSplitter causing issues

WilliamHua opened this issue · comments

commented

Whenever I use BLKDelegateSplitter rather than self.tableView.delegate = self, it is crashing the app on click on on scroll. The error I am getting is:

-[__NSCFString scrollViewDidScroll:]: unrecognized selector sent to instance. 

When I just assign the delegate to the behaviorDefiner, it also works as intended. I looked through the issues but I couldn't find anything related to this.

I have tried swapping the first and second selector.

I am using version 1.0.2.

commented

From the trace, seems you are sending scrollViewDidScroll to NSCFString, or NSString? It's super weird for a delegate to be NSString. Add a breakpoint to see where the delegate is called.

commented

Sorry but after I put in a breakpoint do I have to type something into the console to see where the delegate is called?

A quick fix I made was just to use my original ViewController as the delegate and call the behaviorDefiner from the ViewController.

commented

for lldb, type bt for back trace or po $obj to check the objects.

commented

the delegate spliter works fine on my side, but you have to know, if both of your delegates has the same method implemented, only first delegate will get the method call. For example, if both delegates wait for scrollViewDidScroll, only first delegate will get the call. So you may need to change the BLK source code to get correct forward.

commented

@liuxuan30 I think what you say is incorrect.
My guess @WilliamHua is that the delegate property of your tableview is weak, thus you need to keep a strong reference to BLKDelegateSplitter somewhere