You can use ##
to concatenate two tokens together. However the preprocessor can't change the case of a token. So you have to provide a uppercase property name yourself.
Something like this should work
#define SetNSStringDefaultForPropertyWithNameAndKey(propertyName, propertyKey) - (void)set ## propertyName:(id)object { [[NSUserDefaults standardUserDefaults] objectForKey: _userDefaultsKey][propertyKey] = object; }
And because the preprocessor can't change to uppercase you have to provide the property name with the first letter capitalized
SetNSStringDefaultForPropertyWithNameAndKey(Foobar, @"foobar")
GetNSStringDefaultForPropertyWithNameAndKey(foobar, @"foobar")