James Ye
James Ye

Reputation: 107

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?

Upvotes: 0

Views: 451

Answers (1)

sunkehappy
sunkehappy

Reputation: 9101

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

Upvotes: 1

Related Questions