Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

sourceListDeleteKeyPressedOnRows: called twice #43

Closed
jdrukman opened this issue Jun 7, 2014 · 3 comments
Closed

sourceListDeleteKeyPressedOnRows: called twice #43

jdrukman opened this issue Jun 7, 2014 · 3 comments

Comments

@jdrukman
Copy link

jdrukman commented Jun 7, 2014

Just what it says. Whenever I press the delete key, that method fires twice with an identical notification. I'm sure I'm doing something wrong, but I don't know where to start looking. Help!

@alexrozanski
Copy link
Owner

Are you using PXSourceList > 2.0.0? I've got a hunch for what might be wrong:

In PXSourceListDelegateDataSourceProxy.m, try changing the name passed to -removeObserver:name:object: on line 73 at the current version (see https://github.com/Perspx/PXSourceList/blob/master/PXSourceList/Internal/PXSourceListDelegateDataSourceProxy.m#L73 ) from self to self.sourceList.

Let me know if this fixes the problem.

@jdrukman
Copy link
Author

jdrukman commented Jun 7, 2014

Yes, that fixed it! Thank you!

@alexrozanski
Copy link
Owner

Great, thanks!

The issue was that setting the delegate twice wasn't unregistering the previous delegate from receiving those notifications which is why the method was getting called twice.

I'm guessing you might be setting the delegate in IB and then in your -awakeFromNib or similar as well. Whilst this is slightly inefficient, it shouldn't cause problems like this!

I'll get a release of PXSourceList out to fix this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants