ios - Defining a Macro for a property that works with different objects? -
Is it possible to define the macro for the property setting like background collector for multiple objects?
For example:
#define RedColor [UIColor redColor] #define BackgroundColor (color) [[Self class] setBackgroundColor: Color (color)] Because I can use it in such cases:
[myLabel BackgroundColor (RedColor)]; [MyButton BackgroundColor (RedColor)];
Although you do not recommend doing this, the following code works for me Is:
#define BackgroundColor (color, some_view) [some_view setback color: color]
Comments
Post a Comment