ios - 'SpringBoard' may not respond to presentViewController -
i'm trying make simple baseline tweak ios 9.3.3 display message when springboard starts. keeps giving me error , can't figure out how correct it. appreciated. reason i'm not using uialertview because deprecated.
error:
> making tweak uialertcontrollertest ==> preprocessing tweak.xm ==> compiling tweak.xm (armv7) tweak.xm:9:8: error: 'springboard' may not respond 'dismissviewcontrolleranimated:completion:' [-werror] [self dismissviewcontrolleranimated:yes completion:nil]; ~~~~ ^ tweak.xm:12:8: error: 'springboard' may not respond 'presentviewcontroller:animated:completion:' [-werror] [self presentviewcontroller:alertcontroller animated:yes complet... ~~~~ ^ 2 errors generated. make[3]: *** [/home/theodd/desktop/uialertcontrollertest/.theos/obj/debug/armv7/tweak.xm.ae1dfb2c.o] error 1 make[2]: *** [/home/theodd/desktop/uialertcontrollertest/.theos/obj/debug/armv7/uialertcontrollertest.dylib] error 2 make[1]: *** [internal-library-all_] error 2 make: *** [uialertcontrollertest.all.tweak.variables] error 2
tweak.xm:
#import <springboard/springboard.h> %hook springboard -(void)applicationdidfinishlaunching:(id)application { %orig; uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:@"testtitle" message:@"testmessage" preferredstyle:uialertcontrollerstylealert]; [alertcontroller addaction:[uialertaction actionwithtitle:@"ok" style:uialertactionstyledefault handler:^(uialertaction *action) { [self dismissviewcontrolleranimated:yes completion:nil]; }]]; [self presentviewcontroller:alertcontroller animated:yes completion:nil]; } %end
springboard
fbsystemapp
, , extension, uiapplication
subclass, not uiviewcontroller
. method -presentviewcontroller:animated:completion:
uiviewcontroller
instance method, want call one.
i suggest reading on how classes work, basic objective-c stuff, doesn't have jailbreak-specific.
Comments
Post a Comment