Copying attributes from an object to another

February 9, 2013 in iOS Snippets

[destinationObject setValuesForKeysWithDictionary:
  [sourceObject dictionaryWithValuesForKeys:[[NSArray alloc] initWithObjects:@"attr1", @"attr2", nil]]];