【发布时间】:2015-08-30 12:36:45
【问题描述】:
我的问题不仅涉及+ (NSDictionary *)defaultPropertyValues 方法,还涉及+ (NSArray *)ignoredProperties、+ (NSArray *)indexedProperties 等其他方法。
例如:
//.h - file
@interface A : RLMObject
@property NSString propertyA;
@end
//.m - file
@implementation A
+ (NSDictionary *)defaultPropertyValues {
return @{@"propertyA":@""};
}
@end
比我定义的class B继承形式A
//.h - file
@interface B : A
@property NSString propertyB;
@end
//.m - file
@implementation B
+ (NSDictionary *)defaultPropertyValues {
NSMutableDictionary *defaultValues = [[super defaultPropertyValues]mutableCopy];
[defaultValues setObject:@"" forKey:@"propertyB"];
return defaultValues;
@end
【问题讨论】:
标签: ios objective-c realm