I know that Instance methods can return a value when they are done executing, but I do not know how to set & get that value, I know how to set the parameters but how do I set the return type of Method itself?
So, this is the Instance method implementation:
-(int) returnInteger: (id) anString: (int) anNumber{
to set it´s parameters i do:
[self returnInteger: (id) returnNSString: (int) 100];
But how do I set the value of “returnInteger itself” I want to know how to set i both inside it´s implementation and when I call it (when it executes).
also – one more question
if I set it´s first parameter to be 100 inside the method, and when I call it I want to add 100 to it, how do i do that? i tried this -but did not work
[self returnInteger: (id) returnNSString: (int) + 100];
I’m still not really sure what you’re asking, but here’s an example that may be helpful.