Skip to content

Commit 29ba601

Browse files
committed
Updates for RestKit master for iOS 6 arm7s build error and Xcode 4.5 build warnings. refs RestKit#930
1 parent 48ed605 commit 29ba601

File tree

8 files changed

+24
-16
lines changed

8 files changed

+24
-16
lines changed

Code/CoreData/RKObjectPropertyInspector+CoreData.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ @implementation RKObjectPropertyInspector (CoreData)
3535

3636
- (NSDictionary *)propertyNamesAndTypesForEntity:(NSEntityDescription *)entity
3737
{
38-
NSMutableDictionary *propertyNamesAndTypes = [_cachedPropertyNamesAndTypes objectForKey:[entity name]];
38+
NSMutableDictionary *propertyNamesAndTypes = [_propertyNamesToTypesCache objectForKey:[entity name]];
3939
if (propertyNamesAndTypes) {
4040
return propertyNamesAndTypes;
4141
}
@@ -76,7 +76,7 @@ - (NSDictionary *)propertyNamesAndTypesForEntity:(NSEntityDescription *)entity
7676
}
7777
}
7878

79-
[_cachedPropertyNamesAndTypes setObject:propertyNamesAndTypes forKey:[entity name]];
79+
[_propertyNamesToTypesCache setObject:propertyNamesAndTypes forKey:[entity name]];
8080
RKLogDebug(@"Cached property names and types for Entity '%@': %@", entity, propertyNamesAndTypes);
8181
return propertyNamesAndTypes;
8282
}

Code/ObjectMapping/RKObjectPropertyInspector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@class NSEntityDescription;
2424

2525
@interface RKObjectPropertyInspector : NSObject {
26-
NSMutableDictionary *_cachedPropertyNamesAndTypes;
26+
NSCache *_propertyNamesToTypesCache;
2727
}
2828

2929
+ (RKObjectPropertyInspector *)sharedInspector;

Code/ObjectMapping/RKObjectPropertyInspector.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ + (RKObjectPropertyInspector *)sharedInspector
4242
- (id)init
4343
{
4444
if ((self = [super init])) {
45-
_cachedPropertyNamesAndTypes = [[NSMutableDictionary alloc] init];
45+
_propertyNamesToTypesCache = [[NSCache alloc] init];
4646
}
4747

4848
return self;
4949
}
5050

5151
- (void)dealloc
5252
{
53-
[_cachedPropertyNamesAndTypes release];
53+
[_propertyNamesToTypesCache release];
5454
[super dealloc];
5555
}
5656

@@ -72,7 +72,7 @@ + (NSString *)propertyTypeFromAttributeString:(NSString *)attributeString
7272

7373
- (NSDictionary *)propertyNamesAndTypesForClass:(Class)theClass
7474
{
75-
NSMutableDictionary *propertyNames = [_cachedPropertyNamesAndTypes objectForKey:theClass];
75+
NSMutableDictionary *propertyNames = [_propertyNamesToTypesCache objectForKey:theClass];
7676
if (propertyNames) {
7777
return propertyNames;
7878
}
@@ -108,7 +108,7 @@ - (NSDictionary *)propertyNamesAndTypesForClass:(Class)theClass
108108
currentClass = [currentClass superclass];
109109
}
110110

111-
[_cachedPropertyNamesAndTypes setObject:propertyNames forKey:theClass];
111+
[_propertyNamesToTypesCache setObject:propertyNames forKey:theClass];
112112
RKLogDebug(@"Cached property names and types for Class '%@': %@", NSStringFromClass(theClass), propertyNames);
113113
return propertyNames;
114114
}

Code/ObjectMapping/RKObjectRouter.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ - (void)dealloc
4242
- (void)routeClass:(Class)theClass toResourcePathPattern:(NSString *)resourcePathPattern forMethodName:(NSString *)methodName escapeRoutedPath:(BOOL)addEscapes
4343
{
4444
NSString *className = NSStringFromClass(theClass);
45-
if (nil == [_routes objectForKey:theClass]) {
45+
if (nil == [_routes objectForKey:className]) {
4646
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
47-
[_routes setObject:dictionary forKey:theClass];
47+
[_routes setObject:dictionary forKey:className];
4848
}
4949

50-
NSMutableDictionary *classRoutes = [_routes objectForKey:theClass];
50+
NSMutableDictionary *classRoutes = [_routes objectForKey:className];
5151
if ([classRoutes objectForKey:methodName]) {
5252
[NSException raise:nil format:@"A route has already been registered for class '%@' and HTTP method '%@'", className, methodName];
5353
}
@@ -106,7 +106,8 @@ - (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)m
106106
NSDictionary *classRoutes = nil;
107107

108108
// Check for exact matches
109-
for (Class possibleClass in _routes) {
109+
for (NSString *possibleClassName in _routes) {
110+
Class possibleClass = NSClassFromString(possibleClassName);
110111
if ([object isMemberOfClass:possibleClass]) {
111112
classRoutes = [_routes objectForKey:possibleClass];
112113
break;
@@ -115,7 +116,8 @@ - (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)m
115116

116117
// Check for superclass matches
117118
if (! classRoutes) {
118-
for (Class possibleClass in _routes) {
119+
for (NSString *possibleClassName in _routes) {
120+
Class possibleClass = NSClassFromString(possibleClassName);
119121
if ([object isKindOfClass:possibleClass]) {
120122
classRoutes = [_routes objectForKey:possibleClass];
121123
break;

Code/UI/RKTableViewCellMappings.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,18 @@ - (void)setCellMapping:(RKTableViewCellMapping *)cellMapping forClass:(Class)obj
4545
userInfo:nil];
4646
}
4747

48-
[_cellMappings setObject:cellMapping forKey:objectClass];
48+
[_cellMappings setObject:cellMapping forKey:NSStringFromClass(objectClass)];
4949
}
5050

5151
- (RKTableViewCellMapping *)cellMappingForClass:(Class)objectClass
5252
{
5353
// Exact match
54-
RKTableViewCellMapping *cellMapping = [_cellMappings objectForKey:objectClass];
54+
RKTableViewCellMapping *cellMapping = [_cellMappings objectForKey:NSStringFromClass(objectClass)];
5555
if (cellMapping) return cellMapping;
5656

5757
// Subclass match
58-
for (Class cellClass in _cellMappings) {
58+
for (NSString *cellClassName in _cellMappings) {
59+
Class cellClass = NSClassFromString(cellClassName);
5960
if ([objectClass isSubclassOfClass:cellClass]) {
6061
return [_cellMappings objectForKey:cellClass];
6162
}
18.2 KB
Loading

Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1212
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1313
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
14+
25063C9116021B16007CAC2B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 25063C9016021B16007CAC2B /* Default-568h@2x.png */; };
1415
250CA69A147D8FCC0047D347 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 250CA699147D8FCC0047D347 /* Security.framework */; };
1516
250CA69B147D8FD30047D347 /* libRestKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25160FB31456E8A30060A5C5 /* libRestKit.a */; };
1617
250CA69C147D8FFD0047D347 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E864123424F000ACB5D7 /* CoreData.framework */; };
@@ -82,6 +83,7 @@
8283
1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterAppDelegate.m; sourceTree = "<group>"; };
8384
1D6058910D05DD3D006BFB54 /* RKTwitter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKTwitter.app; sourceTree = BUILT_PRODUCTS_DIR; };
8485
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
86+
25063C9016021B16007CAC2B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
8587
250AC48A1358C79C006F084F /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = "<group>"; };
8688
250CA699147D8FCC0047D347 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
8789
2538E80F123419CA00ACB5D7 /* RKTUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTUser.h; sourceTree = "<group>"; };
@@ -168,6 +170,7 @@
168170
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
169171
isa = PBXGroup;
170172
children = (
173+
25063C9016021B16007CAC2B /* Default-568h@2x.png */,
171174
250AC48A1358C79C006F084F /* RestKit.xcodeproj */,
172175
080E96DDFE201D6D7F000001 /* Classes */,
173176
29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -321,6 +324,7 @@
321324
3F3CE40F125B9B450083FDCB /* BG@2x.png in Resources */,
322325
3F3CE410125B9B450083FDCB /* Default.png in Resources */,
323326
3F3CE411125B9B450083FDCB /* Default@2x.png in Resources */,
327+
25063C9116021B16007CAC2B /* Default-568h@2x.png in Resources */,
324328
);
325329
runOnlyForDeploymentPostprocessing = 0;
326330
};
@@ -354,7 +358,6 @@
354358
isa = XCBuildConfiguration;
355359
buildSettings = {
356360
BUILD_STYLE = Debug;
357-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
358361
COPY_PHASE_STRIP = NO;
359362
GCC_DYNAMIC_NO_PIC = NO;
360363
GCC_OPTIMIZATION_LEVEL = 0;

RestKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,6 +3168,7 @@
31683168
armv6,
31693169
armv7,
31703170
);
3171+
"ARCHS[sdk=iphoneos6.0]" = "$(ARCHS_STANDARD_32_BIT)";
31713172
GCC_PRECOMPILE_PREFIX_HEADER = YES;
31723173
GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch";
31733174
HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2";
@@ -3189,6 +3190,7 @@
31893190
armv6,
31903191
armv7,
31913192
);
3193+
"ARCHS[sdk=iphoneos6.0]" = "$(ARCHS_STANDARD_32_BIT)";
31923194
GCC_PRECOMPILE_PREFIX_HEADER = YES;
31933195
GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch";
31943196
HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2";

0 commit comments

Comments
 (0)