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

TyphoonComponentFactory is released when application goes to background #251

Closed
ararog opened this issue Sep 11, 2014 · 2 comments
Closed

Comments

@ararog
Copy link

ararog commented Sep 11, 2014

I have a business requirement where a singleton managed by Typhoon must be on memory while the application goes to background too, I tried to put the TyphoonComponentFactory in a static variable but it didn't worked, no matter how all singletons managed by Typhoon are release from memory.

Is this a Typhoon limitation/known issue? How to make sure Typhoon singletons keep alive when application goes to background?

@jasperblues
Copy link
Member

We've not encountered this before. As long as the factory is retained it should retain state after backgrounding.

Can you show us how you're setting up and using Typhoon? Ideally email private code samples to [email protected] or post them here.

@ararog
Copy link
Author

ararog commented Sep 11, 2014

I could retain the factory on memory by using this on applicationDidEnterBackground:

UIApplication *app = [UIApplication sharedApplication];

__block UIBackgroundTaskIdentifier bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
    [app endBackgroundTask:bgTask];
    bgTask = UIBackgroundTaskInvalid;
}];

@ararog ararog closed this as completed Sep 11, 2014
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