summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-12-01 06:57:55 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-12-01 06:57:55 -0800
commitbcccf498d65a2328a14a0ea32bac2a7154e8a08a (patch)
treeb3fb0eb8d9bcbad18d621e5749092e860892ecdf /MobileCydia.mm
parent7585ce6664b4c87d7b8711506ba64d354c293e9a (diff)
Use UISearchBar::_searchField if -[UISearchBar searchField] does not exist.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 0b022ee..46d5ddf 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -7504,7 +7504,13 @@ freeing the view controllers on tab change */
search_ = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, [[self view] bounds].size.width, 44.0f)];
[search_ layoutSubviews];
[search_ setPlaceholder:UCLocalize("SEARCH_EX")];
- UITextField *textField = [search_ searchField];
+
+ UITextField *textField;
+ if ([search_ respondsToSelector:@selector(searchField)])
+ textField = [search_ searchField];
+ else
+ textField = MSHookIvar<UITextField *>(search_, "_searchField");
+
[textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin];
[search_ setDelegate:self];
[textField setEnablesReturnKeyAutomatically:NO];