I have searched for the ans in stackoverflow and google too, but didnt get what i need.
What I am looking for:
is there any way to set default values for class properties of a class? Like what we can do in Java, in the constructor of the class eg.-
MyClass(int a, String str){//constructor
this.a = a;
this.str = str;
// i am loking for similar way in obj-C as follows
this.x = a*5;
this.y = 'nothing';
}
Why I am looking for:
I have a class with about 15 properties. When I instantiate the class, I have to set all those variable/properties with some default values. So this makes my code heavy as well complex. If I could set some default values to those instance variables from within that class, that must reduce this code complexity/redundancy.
I need your assistance.
Thanks in advance for your help.
-Sadat