summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-05-17 05:50:54 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-05-17 05:50:54 -0700
commit830efb5d6dcd0f8bd917781184b6af343f824ac7 (patch)
tree9157347266612d058c287d3917ccaf906a52e6f0
parent89bdef78892777df6116a0ef56729834f4b4e0d4 (diff)
Move most of the textField code to back into init.
-rw-r--r--MobileCydia.mm22
1 files changed, 11 insertions, 11 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index fc48972..b89e999 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -7683,8 +7683,19 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
- (id) initWithDatabase:(Database *)database query:(NSString *)query {
if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH")])) {
search_ = [[[UISearchBar alloc] init] autorelease];
+ [search_ setPlaceholder:UCLocalize("SEARCH_EX")];
[search_ setDelegate:self];
+ UITextField *textField;
+ if ([search_ respondsToSelector:@selector(searchField)])
+ textField = [search_ searchField];
+ else
+ textField = MSHookIvar<UITextField *>(search_, "_searchField");
+
+ [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin];
+ [textField setEnablesReturnKeyAutomatically:NO];
+ [[self navigationItem] setTitleView:textField];
+
if (query != nil)
[search_ setText:query];
[self useSearch];
@@ -7698,17 +7709,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
searchloaded_ = YES;
[search_ setFrame:CGRectMake(0, 0, [[self view] bounds].size.width, 44.0f)];
[search_ layoutSubviews];
- [search_ setPlaceholder:UCLocalize("SEARCH_EX")];
-
- UITextField *textField;
- if ([search_ respondsToSelector:@selector(searchField)])
- textField = [search_ searchField];
- else
- textField = MSHookIvar<UITextField *>(search_, "_searchField");
-
- [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin];
- [textField setEnablesReturnKeyAutomatically:NO];
- [[self navigationItem] setTitleView:textField];
}
if ([self isSummarized])