If a NSDecimalNumberHandler is created using the following:
(id)decimalNumberHand开发者_如何学编程lerWithRoundingMode:(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 retain
it.
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 release
message.
精彩评论