Jump to content

6 posts in this topic

Recommended Posts

Posted

Can't find any results on internet.

 

My question is:

 

What are kind of "Returns" besides on 'nil' (NULL)?

 

Another one is what is the return code of 'pass-through'?

 

Any help is appreciated! :)

Posted

You can return everything to anything :lol: ."Pass-through" or how you Flex people call it is %orig

Posted

You can return everything to anything :lol: ."Pass-through" or how you Flex people call it is %orig

so to clarify, there is no more or kinds of return right? And the pass-through if we put it on tweak.xm it is %orig. am I right? :/
Posted

What do you mean 'kind of returns'. You can return what you want there are no restrictions (except function cast) how you return a method. Nil and NULL are not return types. It's just one of many ways.

 

You shouldn't stick with Flex terms. They get you mad in Objective-C coding a lot because you feel urged to translate the code word by word but that's not how it works.

- (void)callMethod {
}

- (void)callMethod {
%orig;
}

is the same, however 'pass-trough' at arguments in Flex means that they are just not used but not in Objective-C

Posted

What do you mean 'kind of returns'. You can return what you want there are no restrictions (except function cast) how you return a method. Nil and NULL are not return types. It's just one of many ways.

 

You shouldn't stick with Flex terms. They get you mad in Objective-C coding a lot because you feel urged to translate the code word by word but that's not how it works.

 

- (void)callMethod {
}

- (void)callMethod {
%orig;
}
is the same, however 'pass-trough' at arguments in Flex means that they are just not used but not in Objective-C
I get it and it work. I tried.

 

In short, putting this on the tweak.xm will give you this:

 

nil = Zero (NULL)

%orig = (The 'pass-through' in Flex) Set to original.

 

Meanwhile, -(void) cannot be change.

 

You can only modify an -(id) with 2 ways. The 'nil' and the '%orig'.

 

Which you'll needed a "return".

 

Example:

 

return nil;

return %orig;

 

This what I understand. And I tried it, it works 100%

Posted

You get it

- (void)callMethod { }

disables a method by the way because nothing gets executed. Also you can return an id more than 2 ways but nvm for now. %orig always calls the original code so it doesn't change if you return it to an id

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