If a NSDecimalNumberHandler is created using the following:
(id)decimalNumberHandlerWithRoundingMode:(NSRoundingMode)roundingMode scale:(short)scale raiseOnExactness:(BOOL)raiseOnExactness raiseOnOverflow:(BOOL)raiseOnOverflow raiseOnUnderflow:(BOOL)raiseOnUnderflow raiseOnDivideByZero:(BOOL)raiseOnDivideByZero
1) Then is it already retained when it is returned? Or is it autoreleased?
2) And subsequently, should we be responsible for “release”-ing it?
1) Then is it already retained when it is returned? Or is it autoreleased?
It returns an autoreleased object, since the method does not contain new alloc or init on its name, therefore you should
retainit.2) And subsequently, should we be responsible for “release”-ing it?
Since you send it a retain message and you “own” it, therefore you are responsible for sending the
releasemessage.