Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

memory usage increases till crash #13

Open
hfccodangel opened this issue Nov 6, 2013 · 3 comments
Open

memory usage increases till crash #13

hfccodangel opened this issue Nov 6, 2013 · 3 comments

Comments

@hfccodangel
Copy link

the viewControllerArray will retain the controllers inside increasing the memory usage and finally crashing the app after some time.
best way to test it is having controllers with some images... every time i swipe the memory increases to never go back down....

how do i fix this?

Thanks for the help and keep up the good job

@malcommac
Copy link
Owner

I've not enough time to work on it but if you can upload a sample project I'll try to fix the error.

@darioissq
Copy link

The problem is: LazyView reloads every page, every time when you go to next or previous page. if you try to go to next page and return to previous page for a bit the result will be app crashes.
I try to use it with NSXML Parser (text and images) with ARC.

@ghost
Copy link

ghost commented May 8, 2014

I solved the memory problem like this...
set NSNULL to viewControllerArray where not index, index - 1 and index + 1
I am a beginner so my Code is a childish one but it solves the problem.

- (UIViewController *) controllerAtIndex:(NSInteger) index {    
 NSLog(@"viewcontrollerARRAY Before : %@",viewControllerArray);
if (delegateCallCount == 0) {
    for (int j = 0; j < numberOfPages; j++) {
        if (j == index || j == index - 1 || j == index + 1) {

        }else {
            [viewControllerArray replaceObjectAtIndex:j withObject:[NSNull null]];
        }
    }
    delegateCallCount++; // in viewDidLoad set "delegateCallCount = 0;".
}else if(delegateCallCount == 2){
    delegateCallCount = 0;
}else{
    delegateCallCount++;
}
.
.
.
return res;
}

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

3 participants