Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update for xcode 4.3.1

  • Loading branch information...
commit 5bfa8beabb36ba33cd7847fef2ff10c8d6258eca 1 parent b500c6f
@pashields authored
View
2  ClassMapper.xcodeproj/project.pbxproj
@@ -314,7 +314,7 @@
848C2429148BE9CA001859C8 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
+ LastUpgradeCheck = 0430;
ORGANIZATIONNAME = "Patrick Shields";
};
buildConfigurationList = 848C242C148BE9CA001859C8 /* Build configuration list for PBXProject "ClassMapper" */;
View
3  ClassMapper/Categories/NSObject+ClassMapper.m
@@ -95,6 +95,8 @@ - (NSObject *)_cm_update_with:(NSDictionary *)serialized withClass:(Class)class
return self;
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+ (Class)classFromAttribute:(NSString *)attr withKey:(NSString *)key {
if ([attr hasPrefix:@"T@,"]) {
if (LOG_ID_OBJ) {
@@ -117,4 +119,5 @@ + (Class)classWithAttributeClass:(Class)attrClass andAttrKey:(NSString *)key {
return attrClass;
}
}
+#pragma clang diagnostic pop
@end
View
28 ClassMapper/MapperConfig.m
@@ -17,15 +17,15 @@ @interface MapperConfig () {
NSMutableDictionary *preProcBlockMappings_;
NSMutableDictionary *postProcBlockMappings_;
}
-@property(nonatomic, strong)NSMutableDictionary *classMappings;
-@property(nonatomic, strong)NSMutableDictionary *propNameMappings;
+@property(nonatomic, strong)NSMutableDictionary *mutableClassMappings;
+@property(nonatomic, strong)NSMutableDictionary *mutablePropNameMappings;
@property(nonatomic, strong)NSMutableDictionary *preProcBlockMappings;
@property(nonatomic, strong)NSMutableDictionary *postProcBlockMappings;
@end
@implementation MapperConfig
-@synthesize classMappings=classMappings_;
-@synthesize propNameMappings=propNameMappings_;
+@synthesize mutableClassMappings=classMappings_;
+@synthesize mutablePropNameMappings=propNameMappings_;
@synthesize preProcBlockMappings=preProcBlockMappings_;
@synthesize postProcBlockMappings=postProcBlockMappings_;
@@ -49,27 +49,27 @@ - (id)init {
return self;
}
- (void)mapKey:(NSString *)key toClass:(Class)class {
- [self.classMappings setObject:class forKey:key];
+ [self.mutableClassMappings setObject:class forKey:key];
}
- (NSDictionary *)classMappings {
- return classMappings_;
+ return self.mutableClassMappings;
}
- (void)mapPropertyName:(NSString *)name toOtherName:(NSString *)other {
- [self.propNameMappings setObject:name forKey:other];
- [self.propNameMappings setObject:other forKey:name];
+ [self.mutablePropNameMappings setObject:name forKey:other];
+ [self.mutablePropNameMappings setObject:other forKey:name];
}
- (NSDictionary *)propertyMappings {
- return propNameMappings_;
+ return self.mutablePropNameMappings;
}
- (void)clearConfig {
- self.classMappings = [NSMutableDictionary dictionary];
- self.propNameMappings = [NSMutableDictionary dictionary];
+ self.mutableClassMappings = [NSMutableDictionary dictionary];
+ self.mutablePropNameMappings = [NSMutableDictionary dictionary];
self.preProcBlockMappings = [NSMutableDictionary dictionary];
self.postProcBlockMappings = [NSMutableDictionary dictionary];
}
- (Class)classFromKey:(NSString *)key {
- return [self.classMappings objectForKey:key] != nil ?
- [self.classMappings objectForKey:key] :
+ return [self.mutableClassMappings objectForKey:key] != nil ?
+ [self.mutableClassMappings objectForKey:key] :
nil;
}
- (void)preProcBlock:(id (^)(id))block forPropClass:(Class)class {
@@ -100,7 +100,7 @@ - (id)postProcessProperty:(id)property ofClass:(Class)class {
#pragma mark protected
/* Give us the mapped key, else the original */
- (NSString *)_trueKey:(NSString *)key {
- NSString *potKey = [self.propNameMappings objectForKey:key];
+ NSString *potKey = [self.mutablePropNameMappings objectForKey:key];
return potKey ? potKey : key;
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.