Jump to content

Question regarding the hooking method


Go to solution Solved by AnotherLurker,

3 posts in this topic

Recommended Posts

  • Solution
Posted (edited)

This is the basic Template:

%hook TargetClass //TargetClass from Flex
- (void)productPurchased:(id)product //Target Method from flex, MAKE SURE to add names after :(id), :(bool), :(int) etc
    name = nil; //Set the argument to nil (null), use the name you provided for the argument
    %orig(); //call %orig;, Note how the method is - (void), if it was something else, use "return %orig();"
}
%end

You result should be: (Please don't look this before attempting to fill out the template above, so you can actual learn)

 

%hook MyLessonsViewController
- (void)productPurchased:(id)product {
   produc = nil;
   %orig();
}
%end

 

 

Updated by JustRick
Posted

This is the basic Template:

%hook TargetClass //TargetClass from Flex
- (void)productPurchased:(id)product //Target Method from flex, MAKE SURE to add names after :(id), :(bool), :(int) etc
    name = nil; //Set the argument to nil (null), use the name you provided for the argument
    %orig(); //call %orig;, Note how the method is - (void), if it was something else, use "return %orig();"
}
%end

You result should be: (Please don't look this before attempting to fill out the template above, so you can actual learn)

 

 

%hook MyLessonsViewController
- (void)productPurchased:(id)product {
   produc = nil;
   %orig();
}
%end

 

 

 

Thank you for the mini tutorial ! Very clear instructions !!! Have a good day :))

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines