Can I give a property in an Objective-C class an alternate name so that I can set the property using a different key than it's property name? Here is some example code.
@interface Address : NSObject
@property (strong, nonatomic) NSNumber *apartmentNumber;
@end
// ...
Address *address = [Address new];
address setValue:@(123) forKey:@"apartmentNumber"];
Is it possible to access this property using an alternate key name like "apt"
?
Address *address = [Address new];
[address setValue:@(123) forKey:@"apt"];
Based on the feedback this seems to work without having to write any additional methods.