title: objective-c: Set dynamic properties
body: <p>I have a function, that recieves an object, a name of a property and its value. 
  Could i set the property of the object with something simple like this:</p>
  
  <pre><code>-(void)dynamicSetterWithProperty:(NSString*)propertyThatIsKnownOnlyInRuntime
                          andValue:(NSString*)valueThatIsKnownOnlyInRuntime{
  
         _myObject.propertyNameThatIsKnownOnlyInRuntime = valueNameThatIsKnownOnlyInRuntime;
  
  }
  </code></pre>
  
  <p>Or do I have to do it in this ugly way:</p>
  
  <pre><code>-(void)dynamicSetterWithProperty:(NSString*)propertyThatIsKnownOnlyInRuntime
                          andValue:(NSString*)valueThatIsKnownOnlyInRuntime{
  
         if([propertyNameThatIsKnownOnlyInRuntime isEqualToString@"name"]){
                _myObject.name = valueNameThatIsKnownOnlyInRuntime;
         }
  
         else if([propertyNameThatIsKnownOnlyInRuntime isEqualToString@"age"]){
                _myObject.age = valueNameThatIsKnownOnlyInRuntime;
         }
  
  }
  </code></pre>