0

I am new to making mobile substrate tweaks and I wanted to hook this function but having a bit of trouble.

%hook classname

- (void)function:(BOOL) {

%orig;
return TRUE;

}

%end

but when i try to MAKE this it gives me an error. void function should not return a value.

I just want to change the BOOL to always return true.

Thanks.

1 Answers1

0

Your aim is vague a bit. The error is because your function header is

- (void)function:(BOOL) foo {
%orig;
return YES;
}

This means function function has a boolean argument and RETURNS NOTHING. So you can't write return YES in your function. This line causes the error.

If your goal is to return the value of the original function with YES argument no matter what foo is, you have to rewrite your function like below:

- (void)function:(BOOL) foo {
%orig(YES);
}
iFred
  • 41
  • 1
  • 5