ioslogoscydia-substrate

Instance methos not found when using logos %new


I'm using logos to make a tweet. I use %new to add a new method - (void)checkTQT to SBAwayController, but when I invoke the method using [self checkTQT], it says "instance method '-checkTQT' not found(return type defaults to 'id')"

here is my code:

%hook SBAwayController
- (void)lock
{
    %orig;
    [self checkTQT];
}

%new(v@:)
- (void)checkTQT
{
    ...
}
%end

Do I use it wrong?


Solution

  • Declare your checkTQT or put it before your lock

    Declare it like this:

    - (void)checkTQT;
    

    Or adjust the sequence:

    %hook SBAwayController
    %new(v@:)
    - (void)checkTQT
    {
        ...
    }
    
    - (void)lock
    {
        %orig;
        [self checkTQT];
    }
    
    %end