Permalink
Browse files

Fix: extract NSString categories to external file

  • Loading branch information...
casademora committed Dec 10, 2011
1 parent 8938488 commit 78262cbad7c489dc0ed740a9b42f2c2693a963dc
@@ -47,6 +47,8 @@
C738127B141039900054EEF0 /* SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json in Resources */ = {isa = PBXBuildFile; fileRef = C7381275141037E80054EEF0 /* SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json */; };
C753897413DB61CE002B2F57 /* GHUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = C753897313DB61CE002B2F57 /* GHUnitTestMain.m */; };
C753897613DB6322002B2F57 /* GHUnit.framework in Copy GHUnit into App Bundle */ = {isa = PBXBuildFile; fileRef = C721C84113D0C6460097AB6F /* GHUnit.framework */; };
+ C758AFD51493C6DC0051E570 /* NSString+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = C758AFD41493C6DC0051E570 /* NSString+MagicalDataImport.m */; };
+ C758AFD61493C6DC0051E570 /* NSString+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = C758AFD41493C6DC0051E570 /* NSString+MagicalDataImport.m */; };
C75A4E7313D0D88D00790CEB /* NSManagedObject+MagicalDataImport.m in Sources */ = {isa = PBXBuildFile; fileRef = C75A4E7213D0D88D00790CEB /* NSManagedObject+MagicalDataImport.m */; };
C75C7D6A147220D400D0C2FE /* generateShorthandFile.rb in Resources */ = {isa = PBXBuildFile; fileRef = C75C7D69147220D300D0C2FE /* generateShorthandFile.rb */; };
C75C7D6B147220D400D0C2FE /* generateShorthandFile.rb in Resources */ = {isa = PBXBuildFile; fileRef = C75C7D69147220D300D0C2FE /* generateShorthandFile.rb */; };
@@ -113,7 +115,7 @@
C7BD889313DBFA6200274567 /* DifferentClassNameMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BD888713DBFA6200274567 /* DifferentClassNameMapping.m */; };
C7BD889413DBFA6200274567 /* SingleEntityWithNoRelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BD888913DBFA6200274567 /* SingleEntityWithNoRelationships.m */; };
C7BD889513DBFA6200274567 /* SingleRelatedEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BD888B13DBFA6200274567 /* SingleRelatedEntity.m */; };
- C7C9A37313F43D93002C5B0C /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C9A37213F43D93002C5B0C /* JSONKit.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+ C7C9A37313F43D93002C5B0C /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C9A37213F43D93002C5B0C /* JSONKit.m */; };
C7C9A37613F44A3C002C5B0C /* ImportSingleEntityRelatedToMappedEntityUsingDefaultsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C9A37513F44A3C002C5B0C /* ImportSingleEntityRelatedToMappedEntityUsingDefaultsTests.m */; };
C7C9A37D13F44B08002C5B0C /* SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.json in Resources */ = {isa = PBXBuildFile; fileRef = C7C9A37C13F44B08002C5B0C /* SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.json */; };
C7C9A37F13F44B29002C5B0C /* SingleEntityRelatedToMappedEntityUsingDefaults.json in Resources */ = {isa = PBXBuildFile; fileRef = C7C9A37E13F44B29002C5B0C /* SingleEntityRelatedToMappedEntityUsingDefaults.json */; };
@@ -246,6 +248,8 @@
C7381275141037E80054EEF0 /* SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json; path = "Unit Tests/Fixtures/SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json"; sourceTree = "<group>"; };
C73812781410383B0054EEF0 /* ImportSingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeysTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImportSingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeysTests.m; path = "Unit Tests/Fixtures/ImportSingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeysTests.m"; sourceTree = "<group>"; };
C753897313DB61CE002B2F57 /* GHUnitTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitTestMain.m; sourceTree = "<group>"; };
+ C758AFD31493C6DC0051E570 /* NSString+MagicalDataImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+MagicalDataImport.h"; path = "DataImport/NSString+MagicalDataImport.h"; sourceTree = "<group>"; };
+ C758AFD41493C6DC0051E570 /* NSString+MagicalDataImport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+MagicalDataImport.m"; path = "DataImport/NSString+MagicalDataImport.m"; sourceTree = "<group>"; };
C75A4E7113D0D88D00790CEB /* NSManagedObject+MagicalDataImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSManagedObject+MagicalDataImport.h"; sourceTree = "<group>"; };
C75A4E7213D0D88D00790CEB /* NSManagedObject+MagicalDataImport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObject+MagicalDataImport.m"; sourceTree = "<group>"; };
C75C7D69147220D300D0C2FE /* generateShorthandFile.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = generateShorthandFile.rb; sourceTree = "<group>"; };
@@ -382,6 +386,8 @@
children = (
C7F5EEB0148DC76700964607 /* NSObject+MagicalDataImport.h */,
C7F5EEB1148DC76700964607 /* NSObject+MagicalDataImport.m */,
+ C758AFD31493C6DC0051E570 /* NSString+MagicalDataImport.h */,
+ C758AFD41493C6DC0051E570 /* NSString+MagicalDataImport.m */,
C75A4E7113D0D88D00790CEB /* NSManagedObject+MagicalDataImport.h */,
C75A4E7213D0D88D00790CEB /* NSManagedObject+MagicalDataImport.m */,
C7005F1014140F9B0061B9F4 /* NSNumber+MagicalDataImport.h */,
@@ -967,6 +973,7 @@
C7005F1A14140FD30061B9F4 /* NSRelationshipDescription+MagicalDataImport.m in Sources */,
C7005F2214153A060061B9F4 /* NSEntityDescription+MagicalDataImport.m in Sources */,
C7F5EEB2148DC76700964607 /* NSObject+MagicalDataImport.m in Sources */,
+ C758AFD51493C6DC0051E570 /* NSString+MagicalDataImport.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1028,6 +1035,7 @@
C7005F1B14140FD30061B9F4 /* NSRelationshipDescription+MagicalDataImport.m in Sources */,
C7005F2314153A060061B9F4 /* NSEntityDescription+MagicalDataImport.m in Sources */,
C7F5EEB3148DC76700964607 /* NSObject+MagicalDataImport.m in Sources */,
+ C758AFD61493C6DC0051E570 /* NSString+MagicalDataImport.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1192,7 +1200,7 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = "";
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
@@ -1241,7 +1249,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iOS App Unit Tests/iOS App Unit Tests-Prefix.pch";
- GCC_VERSION = "";
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
@@ -0,0 +1,15 @@
+//
+// NSString+MagicalRecord_MagicalDataImport.h
+// Magical Record
+//
+// Created by Saul Mora on 12/10/11.
+// Copyright (c) 2011 Magical Panda Software LLC. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSString (MagicalRecord_DataImport)
+
+- (NSString *) MR_capitalizedFirstCharaterString;
+
+@end
@@ -0,0 +1,21 @@
+//
+// NSString+MagicalRecord_MagicalDataImport.m
+// Magical Record
+//
+// Created by Saul Mora on 12/10/11.
+// Copyright (c) 2011 Magical Panda Software LLC. All rights reserved.
+//
+
+#import "NSString+MagicalDataImport.h"
+
+
+@implementation NSString (MagicalRecord_DataImport)
+
+- (NSString *) MR_capitalizedFirstCharaterString;
+{
+ NSString *firstChar = [[self substringToIndex:1] capitalizedString];
+ return [firstChar stringByAppendingString:[self substringFromIndex:1]];
+}
+
+@end
+
@@ -17,7 +17,7 @@ extern NSString * const kMagicalRecordImportRelationshipMapKey;
extern NSString * const kMagicalRecordImportRelationshipPrimaryKey;
extern NSString * const kMagicalRecordImportRelationshipTypeKey;
-@interface NSManagedObject (NSManagedObject_DataImport)
+@interface NSManagedObject (MagicalRecord_DataImport)
- (void) MR_importValuesForKeysWithDictionary:(id)objectData;
- (void) MR_updateValuesForKeysWithDictionary:(id)objectData;
@@ -20,16 +20,6 @@
NSString * const kMagicalRecordImportRelationshipPrimaryKey = @"primaryRelationshipKey";
NSString * const kMagicalRecordImportRelationshipTypeKey = @"type";
-@implementation NSString (MagicalRecord_DataImport)
-
-- (NSString *) MR_capitalizedFirstCharaterString;
-{
- NSString *firstChar = [[self substringToIndex:1] capitalizedString];
- return [firstChar stringByAppendingString:[self substringFromIndex:1]];
-}
-
-@end
-
@implementation NSManagedObject (MagicalRecord_DataImport)
- (id) MR_valueForAttribute:(NSAttributeDescription *)attributeInfo fromObjectData:(NSDictionary *)objectData forKeyPath:(NSString *)keyPath
@@ -17,7 +17,7 @@
#import <CoreData/CoreData.h>
#ifndef MR_USE_ARC
-#define MR_USE_ARC 1
+#define MR_USE_ARC __has_feature(objc_arc)
#endif
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_5_0
@@ -62,6 +62,7 @@
#import "NSManagedObject+MagicalDataImport.h"
#import "NSNumber+MagicalDataImport.h"
#import "NSObject+MagicalDataImport.h"
+#import "NSString+MagicalDataImport.h"
#import "NSAttributeDescription+MagicalDataImport.h"
#import "NSRelationshipDescription+MagicalDataImport.h"
#import "NSEntityDescription+MagicalDataImport.h"
@@ -5,7 +5,8 @@
-@interface NSManagedObject (NSManagedObject_DataImportShortHand)
+
+@interface NSManagedObject (MagicalRecord_DataImportShortHand)
- (void) importValuesForKeysWithDictionary:(id)objectData;
- (void) updateValuesForKeysWithDictionary:(id)objectData;
+ (id) importFromDictionary:(id)data;

0 comments on commit 78262cb

Please sign in to comment.