Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Unrecognized selector crashes #13

@hpique

Description

@hpique

I'm getting "unrecognized selector" crashes in PSPDFTextView.

-[PSPDFTextView scrollViewDidScroll:]: unrecognized selector sent to instance 0x1641f200

These started after implementing scrollViewDidScroll: in the PSPDFTextView/UITextView (real) delegate, a UIViewController. To reproduce, dealloc the UIViewController while still scrolling.

The stack trace:

screen shot 2014-02-23 at 00 53 00

Looks like it might be a delegate forwarding issue, but after looking at the code I'm not exactly sure what might be causing it.

If I add the following to PSPDFTextView the crashes disappear.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if ([_realDelegate respondsToSelector:@selector(scrollViewDidScroll:)])
    {
        [_realDelegate scrollViewDidScroll:scrollView];
    }
}

However, this is a patch that hides the real issue. Any idea of what it might be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions