1

I'm trying to write a test tweak for iOS 8.3 using Theos.

This tweak will show a UIAlertView with two choices when the user taps on an application's icon.

I want to distinguish between the buttons, and to do so I need to add the UIAlertViewDelegate.

Following this example written by DHowett, I've adapted his code to run under iOS 8.3.

The code compiles and loads fine but no action is triggered when I tap on any icon.

If I simply hook into SBApplicationIcon with the correct method, action is triggered but this way I'm not able to distinguish button press.

Is this still a good way to add protocols?

luk2302
  • 55,258
  • 23
  • 97
  • 137
PeppeLaKappa
  • 139
  • 11

1 Answers1

0

You can cast the class you're hooking into to id<ProtocolName> when setting the delegate.

For instance, in your case it would be something like:

[alert setDelegate: (id<UIAlertViewDelegate>) self];
Dan
  • 872
  • 10
  • 24