I'm using objc_[sg]etAssociatedObject()
, and this function uses a memory address as a key. If I pass the same string literal - e.g. "UIImageForTexture"
- into the function from two different files, will the two string literals have:
I can do this more explicitly by sticking the literal in a file somewhere and referring to it via an extern
but I'd like to know if I can avoid having to do that.
This is going to be an implementation defined behavior from the C99 draft standard section 6.4.5
String literals paragraph 6 says:
It is unspecified whether these arrays are distinct provided their elements have the appropriate values. If the program attempts to modify such an array, the behavior is undefined.