According to https://developer.apple.com/documentation/foundation/nsmutabledictionary/1411616-setobject?language=objc -> "Raises an NSInvalidArgumentException if anObject is nil. If you need to represent a nil value in the dictionary, use NSNull."
I have come across a situation when errResponse came out as nil and because of that my app was breaking. And I saw the same code repeatedly used 5 times so I refactored into a single private method. I have never really written a proper ObjC code so you could let me know best practices if you wish.
Kindly test at your end 👍
According to https://developer.apple.com/documentation/foundation/nsmutabledictionary/1411616-setobject?language=objc -> "Raises an NSInvalidArgumentException if anObject is nil. If you need to represent a nil value in the dictionary, use NSNull." I have come across a situation when errResponse came out as nil and because of that my app was breaking. And I saw the same code repeatedly used 5 times so I refactored into a single private method. I have never really written a proper ObjC code so you could let me know best practices if you wish. Kindly test at your end 👍