Reputation: 111
I wrote a tweak for cydia
, but it does not seem to be working. I created the template using Theos
. I got a header dump from the iosod tool, and found
`$` - (void)searchBarTextDidBeginEditing:(id)searchBarText;
inside of the SBSearchController class. Here is the code I have in the Tweak.
%hook SBSearchController
- (void)searchBarTextDidBeginEditing:(id)searchBarText
{
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Tweak"
message:@"Testing is running!"
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
[alert release];`
}
%end
and my Makefile looks like this
include theos/makefiles/common.mk
Testing_FRAMEWORKS = UIKit
TWEAK_NAME = Testing
Testing_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk \
Everything compiles and installs correctly, but at runtime, when I tap on the search bar, and begin to type, nothing happens. Does anybody know what I did wrong?
Thanks!
Upvotes: 2
Views: 486
Reputation:
Remember that since this is a delegate method it won't be called unless the delegate class implements the method. Have you tested this on an application which handles this event?
Try adding some logging to a file so you can see whether your code is being called or not.
Upvotes: 1