Get string value of class propery names in Objective-C
- by Flash84x
I have the following class definition.
Contact.h
#import <CoreData/CoreData.h>
@interface Contact : NSManagedObject
{
}
@property (nonatomic, retain) NSString * City;
@property (nonatomic, retain) NSDate * LastUpdated;
@property (nonatomic, retain) NSString * Country;
@property (nonatomic, retain) NSString * Email;
@property (nonatomic, retain) NSNumber * Id;
@property (nonatomic, retain) NSString * ContactNotes;
@property (nonatomic, retain) NSString * State;
@property (nonatomic, retain) NSString * StreetAddress2;
@property (nonatomic, retain) NSDate * DateCreated;
@property (nonatomic, retain) NSString * FirstName;
@property (nonatomic, retain) NSString * Phone1;
@property (nonatomic, retain) NSString * PostalCode;
@property (nonatomic, retain) NSString * Website;
@property (nonatomic, retain) NSString * StreetAddress1;
@property (nonatomic, retain) NSString * LastName;
@end
Is it possible to obtain an array of NSString objects with all of the properties by name?
Array would look like this...
[@"City", @"LastUpdated", @"Country", .... ]