I have a NSString called fontType
and I am trying to have a custom setter for it:
- (void) setFontType:(NSString *) fType
{
if (self.fontType != fType){
[fontType release];
self.fontType = [fType retain];
//some more custom code
}
}
Is there any issue with this?
A few things that stand out for me:
self.inside of custom accessors. access the variable directlymutable subtype
// some more custom codeMy personal style preferences are like so:
Cocoa with Love has a good article on this topic. It’s worth a read.