views:

20

answers:

0

Im making a gallery and using a scrollview to show fullscreen size images, after som images i recive a memory warning, right now i didrecivememorywaring

`

 - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
    for (unsigned i = 0; i < [appDelegate.inGallery count]; i++) {
    if (i != currentPage && i != currentPage +1 && i != currentPage -1) {
        ScrollViewPic *controller = [viewControllers objectAtIndex:i];
        if ((NSNull *)controller != [NSNull null]) {
            controller._imageView.image = nil;

        } 
        [controller release];

    }    
}

}

how do i release the controller compleatley.

hope someone understand.