It seems that in your case you are trying to use an instance variable the class you are connecting. Changing an instance variable does not work this way in settings. You must use MSHookIvar to "intercept" the instance variable (aka ivar). Example:
[Tweak.xm / mm]
#import <substrate.h> // necessary
#import <Foundation/Foundation.h>
@interface TheClassYouAreHooking : NSObject {
NSString *_exampleVariable;
}
- (void)doSomething;
@end
NSString *_exampleVariableHooked;
%hook TheClassYouAreHooking
- (void)doSomething
{
exampleVariableHooked = MSHookIvar<NSString *>(self, "_exampleVariable");
exampleVariableHooked = @"Hello World";
}
%end
MSHookIvar can also connect things like BOOL and float, etc.
exampleVariableHooked = MSHookIvar<BOOL>(self, "_someBOOL");
.h, , . , , , /, tweakname.plist.
, , , . !