Creating a "permanent" Cocoa object
- by quixoto
I have an object factory that hands out instances of certain "constant" objects. I'd like these objects to be protected against bad memory management by clients. This is how I've overridden the class's key methods. Am I missing anything (code or other considerations)?
- (id)retain
{
return self;
}
- (NSUInteger)retainCount
{
return UINT_MAX;
}
- (void)release
{
// nothing.
}