title: Objective-C set default value for a property
body: <p>I'm making an app, and I have a class with quite a lot properties and I was wondering if it was possible to give them a default value. Because if I make an init method, it's a lot of work to type everything, there's a big chance of typo's and it's just not nice coding...</p>
  
  <p>This is how my class looks like:</p>
  
  <pre><code>// Goalkeeping attributes
  @property (nonatomic) int aerialAbility;
  @property (nonatomic) int commandOfArea;
  @property (nonatomic) int communication;
  @property (nonatomic) int eccentricity;
  @property (nonatomic) int handling;
  @property (nonatomic) int kicking;
  @property (nonatomic) int oneOnOnes;
  @property (nonatomic) int reflexes;
  @property (nonatomic) int rushingOut;
  @property (nonatomic) int tendencyToPunch;
  @property (nonatomic) int throwing;
  
  // Technical attributes
  @property (nonatomic) int corners;
  @property (nonatomic) int crossing;
  @property (nonatomic) int dribbling;
  @property (nonatomic) int finishing;
  @property (nonatomic) int firstTouch;
  @property (nonatomic) int freeKickTaking;
  @property (nonatomic) int heading;
  @property (nonatomic) int longShots;
  @property (nonatomic) int longThrows;
  @property (nonatomic) int marking;
  @property (nonatomic) int passing;
  @property (nonatomic) int penaltyTaking;
  @property (nonatomic) int tackling;
  @property (nonatomic) int technique;
  
  // Mental attributes
  @property (nonatomic) int aggression;
  @property (nonatomic) int anticipation;
  @property (nonatomic) int bravery;
  @property (nonatomic) int composure;
  @property (nonatomic) int concentration;
  @property (nonatomic) int creativity;
  @property (nonatomic) int decisions;
  @property (nonatomic) int determination;
  @property (nonatomic) int flair;
  @property (nonatomic) int influence;
  @property (nonatomic) int offTheBall;
  @property (nonatomic) int positioning;
  @property (nonatomic) int teamwork;
  @property (nonatomic) int workRate;
  
  // Physical attributes
  @property (nonatomic) int acceleration;
  @property (nonatomic) int agility;
  @property (nonatomic) int balance;
  @property (nonatomic) int jumping;
  @property (nonatomic) int naturalFitness;
  @property (nonatomic) int pace;
  @property (nonatomic) int stamina;
  @property (nonatomic) int strength;
  </code></pre>
  
  <p>So then, in the implementation, I'm doing something like:</p>
  
  <pre><code>@synthesize aerialAbility = _aerialAbility;
  </code></pre>
  
  <p>And I was wondering if it would be possible to do this:</p>
  
  <pre><code>@interface MyClass : NSObject
  @property (nonatomic) int someProperty;
  
  @end
  
  @implementation MyClass
  @synthesize someProperty = _someProperty = 10;
  @end
  </code></pre>
  
  <p>I know this won't work, and this doesn't right at all, but I was wondering if there's a way to do something like this.</p>
  
  <p>Like in java you can:</p>
  
  <pre><code>class MyClass
  {
  private int someProperty = 10;
  public int getSomeProperty(){return someProperty;}
  public void setSomeProperty(int someProperty){this.someProperty = someProperty;}
  }
  </code></pre>