Best way to define an immutable class in Objective C
I am a newbie in Objective C and I was wondering what is the best way to define an immutable class in Objective-C (like NSString for example). I want to know what are the basic rules one has to follow to make a class immutable. I think that : setters shouldn't be provided if properties are used, they should be readonly to "disable" Key Value Coding , accessInstanceVariablesDirectly must be override and return NO Did I forget something ? Thanks The first and foremost thing you should do is to include usage comments in your .h file that explain that this is an immutable class, along with the