Calling function within function, when self is not available

时间:2017-06-15 10:21:50

标签: ios objective-c jailbreak theos cydia

I have two functions, handleTouch, and handleDoubleTap.-

%hook MKMapGestureController

-(void)handleTouch:(id)arg1{
    %orig;
}

- (void)handleDoubleTap:(id)arg1{
    %orig;
}

%end

Now what I would like to do, is swap handleTouch and handleDoubleTap around. So that when either one is called, technically the other one is called.

I tried [self handleTouch];, to which I got two errors

error: receiver type 'MKMapGestureController' for instance message is a forward declaration

note: forward declaration of class here

I've tried that, along with replacing self with MKMapGestureController, and a few other things all of which failed.

0 个答案:

没有答案