Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flickering UIImageView

I have created a kiosk application with a main view and a modal view with an image carousel as a screensaver. This modal view slides down whenever the screen is touched.

If the devices are left alone for a very long time (overnight) with the app running, the screen gets redraw problems when the screensaver modal animates away. It looks like the os has nothing to draw where the background image of the main screen is. The controls and text on the main screen draw like they should, only the background image is replaced by artifacts of the hiding animation from the modal. This happens on two devices (iPad 2 3G 16GB). This only occurs if the app has been running for a very long time, and it does not matter whether the screen is on or not. The background UIImageView in question is a vanilla UIImageView with no properties other than the "Image" changed.

It looks like this (client logo and some text blurred out): http://tinypic.com/view.php?pic=2qx47bt&s=6

Any ideas of what could be wrong and how to fix it?

Edit: Here is the code hiding the screensaver. Very standard, no hocus pocus.

- (void)hideScreenSaver {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (![[[self mainViewController] presentedViewController] isKindOfClass:[UINavigationController class]]) {
            [[self mainViewController] dismissModalViewControllerAnimated:TRUE];
        }
    });
}

The screensaverViewController is created in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions (in the main thread)

[[GMAppManager sharedManager] setScreenSaverViewController:[[AAScreenSaverViewController alloc] initWithNibName:@"AAScreenSaverViewController" bundle:nil]];
like image 363
Maciej Swic Avatar asked Feb 13 '26 20:02

Maciej Swic


1 Answers

`I have absolutely had this problem at it was simply a leak on a uikit resource. Run build and analyze and fix leaks. Also set break points on all your deallocs and make sure they are being called. A dealloc will not get called if even a single reference to a part of the class is retained and not released. Check also all objects that you pass a parameter:self. These references to self if the object using self is not release will also block dealloc. Autorelease pools will not drain if the loop is tight. Try using explicit releases. Delgates need to be assign and not retain.

Post up some more errors and questions and I take a look. You have a cool project.

like image 193
nolimitsdude Avatar answered Feb 15 '26 11:02

nolimitsdude



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!