diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-20 21:24:02 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-20 21:24:02 -0700 |
commit | e965092ab8816f600cc49eb9aa611982f66f933a (patch) | |
tree | 1994e522d49276fcc0a4ad22de30583f779b3cb1 | |
parent | 1e76e87db5964bc41362282d49cfdeb3169f7455 (diff) |
On 2.x we cannot use unselectedViewController.
-rw-r--r-- | MobileCydia.mm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 2b16ee2..4b9aef3 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -6751,6 +6751,17 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation CYTabBarController - (void) setUnselectedViewController:(UIViewController *)transient { + if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_iPhoneOS_3_0) { + if (transient != nil) { + [[[self viewControllers] objectAtIndex:0] pushViewController:transient animated:YES]; + [self setSelectedIndex:0]; + } return; + } + + UINavigationController *navigation([[[UINavigationController alloc] init] autorelease]); + [navigation setViewControllers:[NSArray arrayWithObject:transient]]; + transient = navigation; + NSMutableArray *controllers = [[self viewControllers] mutableCopy]; if (transient != nil) { if (transient_ == nil) @@ -9590,11 +9601,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (BOOL) openCydiaURL:(NSURL *)url forExternal:(BOOL)external { CyteViewController *page([self pageForURL:url forExternal:external]); - if (page != nil) { - UINavigationController *nav = [[[UINavigationController alloc] init] autorelease]; - [nav setViewControllers:[NSArray arrayWithObject:page]]; - [tabbar_ setUnselectedViewController:nav]; - } + if (page != nil) + [tabbar_ setUnselectedViewController:page]; return page != nil; } |