]> git.saurik.com Git - cydia.git/commitdiff
Use UISearchBar::_searchField if -[UISearchBar searchField] does not exist.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 1 Dec 2010 14:57:55 +0000 (06:57 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 1 Dec 2010 14:57:55 +0000 (06:57 -0800)
MobileCydia.mm

index 0b022ee3e4bc3136b0aa02a8a6a95b8e02ee2025..46d5ddfb48893ac63d03a0e9665000b69fc7150c 100644 (file)
@@ -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];