user1455332
user1455332

Reputation: 111

What is wrong with this Tweak for Cydia?

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

Answers (1)

user1282993
user1282993

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

Related Questions