From 29ba601cfc38560be923f57fba545881d0789ea5 Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Thu, 13 Sep 2012 09:47:50 -0400 Subject: [PATCH] Updates for RestKit master for iOS 6 arm7s build error and Xcode 4.5 build warnings. refs #930 --- .../RKObjectPropertyInspector+CoreData.m | 4 ++-- Code/ObjectMapping/RKObjectPropertyInspector.h | 2 +- Code/ObjectMapping/RKObjectPropertyInspector.m | 8 ++++---- Code/ObjectMapping/RKObjectRouter.m | 12 +++++++----- Code/UI/RKTableViewCellMappings.m | 7 ++++--- Examples/RKTwitter/Default-568h@2x.png | Bin 0 -> 18594 bytes .../RKTwitter.xcodeproj/project.pbxproj | 5 ++++- RestKit.xcodeproj/project.pbxproj | 2 ++ 8 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 Examples/RKTwitter/Default-568h@2x.png diff --git a/Code/CoreData/RKObjectPropertyInspector+CoreData.m b/Code/CoreData/RKObjectPropertyInspector+CoreData.m index 267b6e448b..9f93400391 100644 --- a/Code/CoreData/RKObjectPropertyInspector+CoreData.m +++ b/Code/CoreData/RKObjectPropertyInspector+CoreData.m @@ -35,7 +35,7 @@ @implementation RKObjectPropertyInspector (CoreData) - (NSDictionary *)propertyNamesAndTypesForEntity:(NSEntityDescription *)entity { - NSMutableDictionary *propertyNamesAndTypes = [_cachedPropertyNamesAndTypes objectForKey:[entity name]]; + NSMutableDictionary *propertyNamesAndTypes = [_propertyNamesToTypesCache objectForKey:[entity name]]; if (propertyNamesAndTypes) { return propertyNamesAndTypes; } @@ -76,7 +76,7 @@ - (NSDictionary *)propertyNamesAndTypesForEntity:(NSEntityDescription *)entity } } - [_cachedPropertyNamesAndTypes setObject:propertyNamesAndTypes forKey:[entity name]]; + [_propertyNamesToTypesCache setObject:propertyNamesAndTypes forKey:[entity name]]; RKLogDebug(@"Cached property names and types for Entity '%@': %@", entity, propertyNamesAndTypes); return propertyNamesAndTypes; } diff --git a/Code/ObjectMapping/RKObjectPropertyInspector.h b/Code/ObjectMapping/RKObjectPropertyInspector.h index 4749439ecd..a1a0c074bf 100644 --- a/Code/ObjectMapping/RKObjectPropertyInspector.h +++ b/Code/ObjectMapping/RKObjectPropertyInspector.h @@ -23,7 +23,7 @@ @class NSEntityDescription; @interface RKObjectPropertyInspector : NSObject { - NSMutableDictionary *_cachedPropertyNamesAndTypes; + NSCache *_propertyNamesToTypesCache; } + (RKObjectPropertyInspector *)sharedInspector; diff --git a/Code/ObjectMapping/RKObjectPropertyInspector.m b/Code/ObjectMapping/RKObjectPropertyInspector.m index 03c0c4027e..6b7c36adbb 100644 --- a/Code/ObjectMapping/RKObjectPropertyInspector.m +++ b/Code/ObjectMapping/RKObjectPropertyInspector.m @@ -42,7 +42,7 @@ + (RKObjectPropertyInspector *)sharedInspector - (id)init { if ((self = [super init])) { - _cachedPropertyNamesAndTypes = [[NSMutableDictionary alloc] init]; + _propertyNamesToTypesCache = [[NSCache alloc] init]; } return self; @@ -50,7 +50,7 @@ - (id)init - (void)dealloc { - [_cachedPropertyNamesAndTypes release]; + [_propertyNamesToTypesCache release]; [super dealloc]; } @@ -72,7 +72,7 @@ + (NSString *)propertyTypeFromAttributeString:(NSString *)attributeString - (NSDictionary *)propertyNamesAndTypesForClass:(Class)theClass { - NSMutableDictionary *propertyNames = [_cachedPropertyNamesAndTypes objectForKey:theClass]; + NSMutableDictionary *propertyNames = [_propertyNamesToTypesCache objectForKey:theClass]; if (propertyNames) { return propertyNames; } @@ -108,7 +108,7 @@ - (NSDictionary *)propertyNamesAndTypesForClass:(Class)theClass currentClass = [currentClass superclass]; } - [_cachedPropertyNamesAndTypes setObject:propertyNames forKey:theClass]; + [_propertyNamesToTypesCache setObject:propertyNames forKey:theClass]; RKLogDebug(@"Cached property names and types for Class '%@': %@", NSStringFromClass(theClass), propertyNames); return propertyNames; } diff --git a/Code/ObjectMapping/RKObjectRouter.m b/Code/ObjectMapping/RKObjectRouter.m index e577d34622..15f419cd31 100644 --- a/Code/ObjectMapping/RKObjectRouter.m +++ b/Code/ObjectMapping/RKObjectRouter.m @@ -42,12 +42,12 @@ - (void)dealloc - (void)routeClass:(Class)theClass toResourcePathPattern:(NSString *)resourcePathPattern forMethodName:(NSString *)methodName escapeRoutedPath:(BOOL)addEscapes { NSString *className = NSStringFromClass(theClass); - if (nil == [_routes objectForKey:theClass]) { + if (nil == [_routes objectForKey:className]) { NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - [_routes setObject:dictionary forKey:theClass]; + [_routes setObject:dictionary forKey:className]; } - NSMutableDictionary *classRoutes = [_routes objectForKey:theClass]; + NSMutableDictionary *classRoutes = [_routes objectForKey:className]; if ([classRoutes objectForKey:methodName]) { [NSException raise:nil format:@"A route has already been registered for class '%@' and HTTP method '%@'", className, methodName]; } @@ -106,7 +106,8 @@ - (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)m NSDictionary *classRoutes = nil; // Check for exact matches - for (Class possibleClass in _routes) { + for (NSString *possibleClassName in _routes) { + Class possibleClass = NSClassFromString(possibleClassName); if ([object isMemberOfClass:possibleClass]) { classRoutes = [_routes objectForKey:possibleClass]; break; @@ -115,7 +116,8 @@ - (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)m // Check for superclass matches if (! classRoutes) { - for (Class possibleClass in _routes) { + for (NSString *possibleClassName in _routes) { + Class possibleClass = NSClassFromString(possibleClassName); if ([object isKindOfClass:possibleClass]) { classRoutes = [_routes objectForKey:possibleClass]; break; diff --git a/Code/UI/RKTableViewCellMappings.m b/Code/UI/RKTableViewCellMappings.m index 86caa707fd..3cf225ff57 100644 --- a/Code/UI/RKTableViewCellMappings.m +++ b/Code/UI/RKTableViewCellMappings.m @@ -45,17 +45,18 @@ - (void)setCellMapping:(RKTableViewCellMapping *)cellMapping forClass:(Class)obj userInfo:nil]; } - [_cellMappings setObject:cellMapping forKey:objectClass]; + [_cellMappings setObject:cellMapping forKey:NSStringFromClass(objectClass)]; } - (RKTableViewCellMapping *)cellMappingForClass:(Class)objectClass { // Exact match - RKTableViewCellMapping *cellMapping = [_cellMappings objectForKey:objectClass]; + RKTableViewCellMapping *cellMapping = [_cellMappings objectForKey:NSStringFromClass(objectClass)]; if (cellMapping) return cellMapping; // Subclass match - for (Class cellClass in _cellMappings) { + for (NSString *cellClassName in _cellMappings) { + Class cellClass = NSClassFromString(cellClassName); if ([objectClass isSubclassOfClass:cellClass]) { return [_cellMappings objectForKey:cellClass]; } diff --git a/Examples/RKTwitter/Default-568h@2x.png b/Examples/RKTwitter/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj b/Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj index d0ec42d783..bba8fc7bcd 100755 --- a/Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj +++ b/Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 25063C9116021B16007CAC2B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 25063C9016021B16007CAC2B /* Default-568h@2x.png */; }; 250CA69A147D8FCC0047D347 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 250CA699147D8FCC0047D347 /* Security.framework */; }; 250CA69B147D8FD30047D347 /* libRestKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25160FB31456E8A30060A5C5 /* libRestKit.a */; }; 250CA69C147D8FFD0047D347 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E864123424F000ACB5D7 /* CoreData.framework */; }; @@ -82,6 +83,7 @@ 1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* RKTwitter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKTwitter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 25063C9016021B16007CAC2B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 250AC48A1358C79C006F084F /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = ""; }; 250CA699147D8FCC0047D347 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 2538E80F123419CA00ACB5D7 /* RKTUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTUser.h; sourceTree = ""; }; @@ -168,6 +170,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 25063C9016021B16007CAC2B /* Default-568h@2x.png */, 250AC48A1358C79C006F084F /* RestKit.xcodeproj */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, @@ -321,6 +324,7 @@ 3F3CE40F125B9B450083FDCB /* BG@2x.png in Resources */, 3F3CE410125B9B450083FDCB /* Default.png in Resources */, 3F3CE411125B9B450083FDCB /* Default@2x.png in Resources */, + 25063C9116021B16007CAC2B /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -354,7 +358,6 @@ isa = XCBuildConfiguration; buildSettings = { BUILD_STYLE = Debug; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; diff --git a/RestKit.xcodeproj/project.pbxproj b/RestKit.xcodeproj/project.pbxproj index 9f55bfc2bc..be393f4311 100644 --- a/RestKit.xcodeproj/project.pbxproj +++ b/RestKit.xcodeproj/project.pbxproj @@ -3168,6 +3168,7 @@ armv6, armv7, ); + "ARCHS[sdk=iphoneos6.0]" = "$(ARCHS_STANDARD_32_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch"; HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2"; @@ -3189,6 +3190,7 @@ armv6, armv7, ); + "ARCHS[sdk=iphoneos6.0]" = "$(ARCHS_STANDARD_32_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch"; HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2";