Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom setter for @property?

How can i use a custom setter for the following property after I synthesized it ?

@property (nonatomic,retain) UIButton *but 
like image 804
Alex Avatar asked Jul 27 '11 10:07

Alex


People also ask

What are kotlin's properties?

Properties. Properties are the variables (to be more precise, member variables) that are declared inside a class but outside the method. Kotlin properties can be declared either as mutable using the “var” keyword or as immutable using the “val” keyword. By default, all properties and functions in Kotlin are public.

What is the purpose of a setter?

Getters and setters are used to protect your data, particularly when creating classes. For each instance variable, a getter method returns its value while a setter method sets or updates its value.

What is getter setter in C#?

Getters and setters are methods used to declare or obtain the values of variables, usually private ones. They are important because it allows for a central location that is able to handle data prior to declaring it or returning it to the developer.

What is an Auto property C#?

What is automatic property? Automatic property in C# is a property that has backing field generated by compiler. It saves developers from writing primitive getters and setters that just return value of backing field or assign to it.


1 Answers

@property (getter=yourGetter,setter=yourSetter:) UIButton *but;
like image 74
andreamazz Avatar answered Oct 05 '22 16:10

andreamazz