Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override @synthesized getters?

how to override a property synthesized getter?

like image 627
Simone D'Amico Avatar asked Feb 18 '11 22:02

Simone D'Amico


2 Answers

Just implement the method manually, for example:

- (BOOL)myBoolProperty {     // do something else     ...     return myBoolProperty; } 

The compiler will then not generate a getter method.

like image 133
Ole Begemann Avatar answered Sep 25 '22 11:09

Ole Begemann


Inside of your property definition you can specify getter and setter methods as follows:

@property (nonatomic, retain, getter = getterMethodName, setter = setterMethodName) NSString *someString; 

You can specify the getter only, the setter only, or both.

like image 35
diadyne Avatar answered Sep 22 '22 11:09

diadyne