0

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?

James Ye
  • 107
  • 7

1 Answers1

1

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
sunkehappy
  • 8,970
  • 5
  • 44
  • 65
  • Thanks for the answer, that gives me a big hint. Simply put `%new` before `- (void)lock` doesn't work, so I write a catagory `@interface SBAwayController() - (void)checkTQT; @end` and that solves the problem – James Ye Feb 05 '13 at 05:22