It seems, in your case, you is trying to use an instance variable of the class is hooking. Modifying the instance variable does not work on that is the tweaks. You have the use of mshookivar to ' hooks ' an instance variable (aka Ivar). Example:
[TWEAK.XM/MM]
#import <substrate.h>//Necessary#import <Foundation/Foundation.h> @interface theclassyouarehooking: NSObject { nsstring *_examplevariable;} -(void) dosomething; @endNSString *_examplevariablehooked;%hook theclassyouarehooking-(void) dosomething { //' Hook ' the variable examplevariablehooked = mshookivar<nsstring *> (self, "_examplevariable"); The name of the hooked variable does not need to being the same examplevariablehooked = @ "Hello World"; You can do anything with the object Eg. [examplevariablehooked release];} %end
Mshookivar can also hook stuff like bools and floats etc.
examplevariablehooked = mshookivar<bool> (self, "_somebool");
Its declared in substrate.h so you need to import the otherwise you'll not being able to compile your tweak. Also as a bonus tip, I ' m just reminding you've had to put the identifier of the app/framework you ' re hooking in R tweakname.plist.
So after you ' hooks ' the variable you can change it to suit your needs. Happy coding!
IOS Hook class member variables