Skip to content

Commit

Permalink
Updates for RestKit master for iOS 6 arm7s build error and Xcode 4.5 …
Browse files Browse the repository at this point in the history
…build warnings. refs #930
  • Loading branch information
blakewatters committed Sep 13, 2012
1 parent 48ed605 commit 29ba601
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Code/CoreData/RKObjectPropertyInspector+CoreData.m
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Code/ObjectMapping/RKObjectPropertyInspector.h
Expand Up @@ -23,7 +23,7 @@
@class NSEntityDescription;

@interface RKObjectPropertyInspector : NSObject {
NSMutableDictionary *_cachedPropertyNamesAndTypes;
NSCache *_propertyNamesToTypesCache;
}

+ (RKObjectPropertyInspector *)sharedInspector;
Expand Down
8 changes: 4 additions & 4 deletions Code/ObjectMapping/RKObjectPropertyInspector.m
Expand Up @@ -42,15 +42,15 @@ + (RKObjectPropertyInspector *)sharedInspector
- (id)init
{
if ((self = [super init])) {
_cachedPropertyNamesAndTypes = [[NSMutableDictionary alloc] init];
_propertyNamesToTypesCache = [[NSCache alloc] init];
}

return self;
}

- (void)dealloc
{
[_cachedPropertyNamesAndTypes release];
[_propertyNamesToTypesCache release];
[super dealloc];
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
12 changes: 7 additions & 5 deletions Code/ObjectMapping/RKObjectRouter.m
Expand Up @@ -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];
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions Code/UI/RKTableViewCellMappings.m
Expand Up @@ -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];
}
Expand Down
Binary file added Examples/RKTwitter/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -82,6 +83,7 @@
1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterAppDelegate.m; sourceTree = "<group>"; };
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 = "<group>"; };
250AC48A1358C79C006F084F /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = "<group>"; };
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 = "<group>"; };
Expand Down Expand Up @@ -168,6 +170,7 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
25063C9016021B16007CAC2B /* Default-568h@2x.png */,
250AC48A1358C79C006F084F /* RestKit.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions RestKit.xcodeproj/project.pbxproj
Expand Up @@ -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";
Expand All @@ -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";
Expand Down

0 comments on commit 29ba601

Please sign in to comment.