Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using setCustomView, app freezes #186

Open
bnetter opened this issue Mar 11, 2014 · 3 comments
Open

When using setCustomView, app freezes #186

bnetter opened this issue Mar 11, 2014 · 3 comments

Comments

@bnetter
Copy link

bnetter commented Mar 11, 2014

Hey Sam,

Thanks for this great plugin. I'm facing a strange problem when using setCustomView though.
I try to load a custom view from a xib file using this code:

    // Getting the views from the xib file
    NSArray *subviews = [[NSBundle mainBundle] loadNibNamed:@"MiscViews" owner:nil options:nil];

    for (UIView *subview in subviews) {
        if ([[subview restorationIdentifier] isEqualToString:@"Loading View"]) {
            // Creating a new view
            UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 150)];

            // Adding the subview form the xib to this view
            [view addSubview:subview];

            // Setting the new view as the view for the loading state
            [self.tableView.pullToRefreshView setCustomView:subview forState:SVInfiniteScrollingStateLoading];
        }
    }

But when the state is loading, the app freezes. From my researches, it's because layoutSubviews (from UIScrollView+SVPullToRefresh) is called repeatedly. Not sure why this happens, and my capacities to debug on Objective-C are kind of limited. I know this doesn't happen when I'm just creating a UIView directly from the code, without using a xib.

Has anyone been facing this problem before or has any idea why this happens?

@bnetter
Copy link
Author

bnetter commented Mar 11, 2014

Ah, apparently this issue is reported there to: #169

@bnetter
Copy link
Author

bnetter commented Mar 11, 2014

Tried to come back to a release that worked, and apparently this never worked well. When setCustomView was introduced, the problem was already here.

@RyanCopley
Copy link

Why are you using SVInfinite constants on the pull to refresh dialog?

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

No branches or pull requests

2 participants