mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
Cleanup trailing whitespace. refs #743
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright (c) 2009-2012 RestKit. All rights reserved.
|
||||
//
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -34,7 +34,7 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
if (sharedInspector == nil) {
|
||||
sharedInspector = [RKObjectPropertyInspector new];
|
||||
}
|
||||
|
||||
|
||||
return sharedInspector;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
if ((self = [super init])) {
|
||||
_cachedPropertyNamesAndTypes = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
NSString *type = [NSString string];
|
||||
NSScanner *typeScanner = [NSScanner scannerWithString:attributeString];
|
||||
[typeScanner scanUpToCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@"@"] intoString:NULL];
|
||||
|
||||
|
||||
// we are not dealing with an object
|
||||
if([typeScanner isAtEnd]) {
|
||||
return @"NULL";
|
||||
@@ -72,14 +72,14 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
return propertyNames;
|
||||
}
|
||||
propertyNames = [NSMutableDictionary dictionary];
|
||||
|
||||
|
||||
//include superclass properties
|
||||
Class currentClass = theClass;
|
||||
while (currentClass != nil) {
|
||||
// Get the raw list of properties
|
||||
unsigned int outCount;
|
||||
objc_property_t *propList = class_copyPropertyList(currentClass, &outCount);
|
||||
|
||||
|
||||
// Collect the property names
|
||||
int i;
|
||||
NSString *propName;
|
||||
@@ -87,9 +87,9 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
// property_getAttributes() returns everything we need to implement this...
|
||||
// See: http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html#//apple_ref/doc/uid/TP40008048-CH101-SW5
|
||||
objc_property_t* prop = propList + i;
|
||||
NSString* attributeString = [NSString stringWithCString:property_getAttributes(*prop) encoding:NSUTF8StringEncoding];
|
||||
NSString* attributeString = [NSString stringWithCString:property_getAttributes(*prop) encoding:NSUTF8StringEncoding];
|
||||
propName = [NSString stringWithCString:property_getName(*prop) encoding:NSUTF8StringEncoding];
|
||||
|
||||
|
||||
if (![propName isEqualToString:@"_mapkit_hasPanoramaID"]) {
|
||||
const char* className = [[RKObjectPropertyInspector propertyTypeFromAttributeString:attributeString] cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
Class aClass = objc_getClass(className);
|
||||
@@ -98,11 +98,11 @@ static RKObjectPropertyInspector* sharedInspector = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(propList);
|
||||
currentClass = [currentClass superclass];
|
||||
}
|
||||
|
||||
|
||||
[_cachedPropertyNamesAndTypes setObject:propertyNames forKey:theClass];
|
||||
RKLogDebug(@"Cached property names and types for Class '%@': %@", NSStringFromClass(theClass), propertyNames);
|
||||
return propertyNames;
|
||||
|
||||
Reference in New Issue
Block a user