How to take these parameters the same way this function does?
صفحه اصلي

How to take these parameters the same way this function does?



For example:

- (BOOL)compare:(NSDecimal)leftOperand greaterThan:(NSDecimal)rightOperand {     NSComparisonResult result = NSDecimalCompare(&leftOperand, &rightOperand);     // rest not important } 

like you can see, the method just receives these two types of NSDecimal, leftOperand and rightOperand. Then it passes them on to a C API function which likes to have them by reference. Sorry if that's the wrong term, didn't study that stuff. Currect me if I'm wrong :-)

I want to modify this method in such a way, that I can also accept parameters the way that function does. I think that's clever, because the method won't copy the parameters (I believe it does). What would I have to add in there in order to get this reference thing right? And after that, my parameters are just references, right? How would I pass these then along to the NSDecimalCompare function?

I slighlty remember there was some dereferencing operator around for that?


Am I using NSUserDefaults wrong?

1:

jQuery live() removing iPhone touch event attributes?
Try:. need a 24 bits type in objc
- (BOOL)compare:(const NSDecimal*)leftOperand greaterThan:(const NSDecimal*)rightOperand {     NSComparisonResult result = NSDecimalCompare(leftOperand, rightOperand);     // rest not important } 
Photo Library view stays on screen after choosing an image with UIImagePickerController

88 out of 100 based on 63 user ratings 298 reviews

*