Sephiroth87 / ODRefreshControl

A pull down to refresh control like the one in Apple's iOS6 Mail App
MIT License
2.15k stars 385 forks source link

Weird unrecognized selector issue #50

Closed niveus closed 6 years ago

niveus commented 11 years ago

I'm probably doing something wrong but I can't seem to figure out what. I'm getting an unrecognized selector issue error on iOS 5 (works on iOS 6). I try putting in a log right before it happens and the class seems to be correct so I really don't understand it.

Code:

NSLog(@"Scrollview: %@", [self.scrollView class]);

[self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)];

Result:

2013-01-04 21:16:33.857 xxx[63650:c07] Scrollview: UIScrollView
2013-01-04 21:16:33.857 xxx[63650:c07] -[UIAccessibilityBundle setContentInset:]: unrecognized selector sent to instance 0xe61d510

The problem is caused when I call beginRefreshing and when it executes, the debugger stops on the setContentInset line. I'm not sure why it thinks its a UIAccessibilityBundle

ShadyElyaski commented 11 years ago

I'm having the same crash reports on iOS 5.1.1 ... Any fixes?

Sephiroth87 commented 11 years ago

Hi, can any of you upload some sample code with the problem so I can take a look?

ShadyElyaski commented 11 years ago

I'm just having this crash report ... Screen Shot 2013-01-15 at 4 33 40 PM

Sephiroth87 commented 11 years ago

I'm unable to reproduce this, and that crash report gives no useful information... Are you using ARC? If not, are you doing something strange, like retaining the control and releasing the scrollView?

Can you post some code that's causing the problem?

niveus commented 11 years ago

Sorry for not getting back on this sooner.

I was never able to get the problem on every load, but I did find it had something to do with the fact I was calling [instance beginRefreshing] then immediately calling [instance stopRefreshing] and updating the table view. Maybe it was calling them right after one another that caused the issue. I removed the beginRefreshing call and I haven't seen it since.

mplulu commented 11 years ago

I have a similar bug, only happen in iOS 5.0. I think it is a bug from Apple. My way to fix it is creating an empty subclass of UIScrollView, then use it instead of UIScrollView.