summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-21 03:35:20 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-21 03:35:49 -0700
commit2fcb1d49a0be54a0d43a4984e6e50e0a2d8d77f9 (patch)
tree99b247e00df126fc99bb7f069072ecf93851cf79 /MobileCydia.mm
parentca6299305858884d89c8be7cca2ab5c67ee58c66 (diff)
Work around stupid 2.x UINavigationController behavior.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 41cc4e7..dd7b14a 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -6747,6 +6747,20 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
@implementation CYTabBarController
+- (void) didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+
+ // presenting a UINavigationController on 2.x does not update its transitionView
+ // it thereby will not allow its topViewController to be unloaded by memory pressure
+ if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iPhoneOS_3_0) {
+ UIViewController *selected([self selectedViewController]);
+ for (UINavigationController *controller in [self viewControllers])
+ if (controller != selected)
+ if (UIViewController *top = [controller topViewController])
+ [top unloadView];
+ }
+}
+
- (void) setUnselectedViewController:(UIViewController *)transient {
if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iPhoneOS_3_0) {
if (transient != nil) {
@@ -6786,6 +6800,14 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
- (void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if ([self unselectedViewController])
[self setUnselectedViewController:nil];
+
+ // presenting a UINavigationController on 2.x does not update its transitionView
+ // if this view was unloaded, the tranitionView may currently be presenting nothing
+ if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iPhoneOS_3_0) {
+ UINavigationController *navigation((UINavigationController *) viewController);
+ [navigation pushViewController:[[[UIViewController alloc] init] autorelease] animated:NO];
+ [navigation popViewControllerAnimated:NO];
+ }
}
- (NSArray *) navigationURLCollection {