mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-30 21:52:30 +08:00
Fix a few spacing issues. Refs #614
This commit is contained in:
@@ -457,7 +457,7 @@ RK_FIX_CATEGORY_BUG(NSManagedObject_ActiveRecord)
|
||||
[request setIncludesSubentities:NO];
|
||||
[request setFetchBatchSize:[self defaultBatchSize]];
|
||||
|
||||
if (sortTerm != nil){
|
||||
if (sortTerm != nil) {
|
||||
NSSortDescriptor *sortBy = [[NSSortDescriptor alloc] initWithKey:sortTerm ascending:ascending];
|
||||
[request setSortDescriptors:[NSArray arrayWithObject:sortBy]];
|
||||
[sortBy release];
|
||||
|
||||
@@ -96,19 +96,19 @@
|
||||
if ([errorResponse isEqualToString:@"invalid_grant"]) {
|
||||
errorCode = RKOAuthClientErrorInvalidGrant;
|
||||
}
|
||||
else if([errorResponse isEqualToString:@"unauthorized_client"]){
|
||||
else if ([errorResponse isEqualToString:@"unauthorized_client"]) {
|
||||
errorCode = RKOAuthClientErrorUnauthorizedClient;
|
||||
}
|
||||
else if([errorResponse isEqualToString:@"invalid_client"]){
|
||||
else if ([errorResponse isEqualToString:@"invalid_client"]) {
|
||||
errorCode = RKOAuthClientErrorInvalidClient;
|
||||
}
|
||||
else if([errorResponse isEqualToString:@"invalid_request"]){
|
||||
else if ([errorResponse isEqualToString:@"invalid_request"]) {
|
||||
errorCode = RKOAuthClientErrorInvalidRequest;
|
||||
}
|
||||
else if([errorResponse isEqualToString:@"unsupported_grant_type"]){
|
||||
else if ([errorResponse isEqualToString:@"unsupported_grant_type"]) {
|
||||
errorCode = RKOAuthClientErrorUnsupportedGrantType;
|
||||
}
|
||||
else if([errorResponse isEqualToString:@"invalid_scope"]){
|
||||
else if ([errorResponse isEqualToString:@"invalid_scope"]) {
|
||||
errorCode = RKOAuthClientErrorInvalidScope;
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
|
||||
|
||||
// Add OAuth headers if necessary
|
||||
// OAuth 1
|
||||
if(self.authenticationType == RKRequestAuthenticationTypeOAuth1){
|
||||
if (self.authenticationType == RKRequestAuthenticationTypeOAuth1) {
|
||||
NSURLRequest *echo = nil;
|
||||
|
||||
// use the suitable parameters dict
|
||||
|
||||
@@ -57,7 +57,7 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue) {
|
||||
// Comparison magic using function pointers. See this page for details: http://www.red-sweater.com/blog/320/abusing-objective-c-with-class
|
||||
// Original code courtesy of Greg Parker
|
||||
// This is necessary because isEqualToNumber will return negative integer values that aren't coercable directly to BOOL's without help [sbw]
|
||||
BOOL (*ComparisonSender)(id, SEL, id) = (BOOL (*)(id, SEL, id)) objc_msgSend;
|
||||
BOOL (*ComparisonSender)(id, SEL, id) = (BOOL (*)(id, SEL, id))objc_msgSend;
|
||||
return ComparisonSender(sourceValue, comparisonSelector, destinationValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
- (NSUInteger)hash {
|
||||
int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * [self.userData hash]? [self.mapping hash] : [self.userData hash];
|
||||
result = prime * [self.userData hash] ? [self.mapping hash] : [self.userData hash];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ BOOL isValidRange(NSRange rangeOfMatch);
|
||||
NSTimeInterval secondsFromMilliseconds(NSTimeInterval millisecs);
|
||||
NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds);
|
||||
|
||||
@interface RKDotNetDateFormatter()
|
||||
@interface RKDotNetDateFormatter ()
|
||||
- (NSString *)millisecondsFromString:(NSString *)string;
|
||||
@end
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ NSString *RKEncodeURLString(NSString *unencodedString) {
|
||||
return [encodedString autorelease];
|
||||
}
|
||||
|
||||
@interface RKPathMatcher()
|
||||
@interface RKPathMatcher ()
|
||||
@property (nonatomic,retain) SOCPattern *socPattern;
|
||||
@property (nonatomic,copy) NSString *sourcePath;
|
||||
@property (nonatomic,copy) NSString *rootPath;
|
||||
|
||||
@@ -62,15 +62,15 @@
|
||||
break;
|
||||
|
||||
case RKFormControlTypeSwitch:;
|
||||
control = [(UIControl *) [UISwitch new] autorelease];
|
||||
control = [(UIControl *)[UISwitch new] autorelease];
|
||||
break;
|
||||
|
||||
case RKFormControlTypeSlider:;
|
||||
control = [(UIControl *) [UISlider new] autorelease];
|
||||
control = [(UIControl *)[UISlider new] autorelease];
|
||||
break;
|
||||
|
||||
case RKFormControlTypeLabel:;
|
||||
control = [(UIControl *) [UILabel new] autorelease];
|
||||
control = [(UIControl *)[UILabel new] autorelease];
|
||||
break;
|
||||
|
||||
case RKFormControlTypeUnknown:
|
||||
|
||||
@@ -1821,7 +1821,7 @@
|
||||
};
|
||||
}]];
|
||||
NSIndexPath* delegateIndexPath = [tableController tableView:tableController.tableView
|
||||
targetIndexPathForMoveFromRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]toProposedIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
|
||||
targetIndexPathForMoveFromRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] toProposedIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
|
||||
assertThat(delegateIndexPath, is(equalTo(moveToIndexPath)));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
return [portCheck isOpen];
|
||||
}
|
||||
|
||||
- (void)testShouldGetAccessToken{
|
||||
- (void)testShouldGetAccessToken {
|
||||
RKOAuthClientTestSkipWithoutMongoDB();
|
||||
|
||||
RKTestResponseLoader *loader = [RKTestResponseLoader responseLoader];
|
||||
@@ -68,7 +68,7 @@
|
||||
assertThatBool(loader.wasSuccessful, is(equalToBool(NO)));
|
||||
}
|
||||
|
||||
- (void)testShouldGetProtectedResource{
|
||||
- (void)testShouldGetProtectedResource {
|
||||
RKOAuthClientTestSkipWithoutMongoDB();
|
||||
|
||||
//TODO: Encapsulate this code in a correct manner
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
queue.suspended = NO;
|
||||
OCMockObject* delegateMock = [OCMockObject niceMockForProtocol:@protocol(RKRequestQueueDelegate)];
|
||||
[[delegateMock expect] requestQueueWasSuspended:queue];
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*) delegateMock;
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*)delegateMock;
|
||||
queue.suspended = YES;
|
||||
[delegateMock verify];
|
||||
[queue release];
|
||||
@@ -91,7 +91,7 @@
|
||||
assertThatBool(queue.suspended, is(equalToBool(YES)));
|
||||
OCMockObject* delegateMock = [OCMockObject niceMockForProtocol:@protocol(RKRequestQueueDelegate)];
|
||||
[[delegateMock expect] requestQueueWasUnsuspended:queue];
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*) delegateMock;
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*)delegateMock;
|
||||
queue.suspended = NO;
|
||||
[delegateMock verify];
|
||||
[queue release];
|
||||
@@ -101,7 +101,7 @@
|
||||
RKRequestQueue* queue = [RKRequestQueue new];
|
||||
OCMockObject* delegateMock = [OCMockObject niceMockForProtocol:@protocol(RKRequestQueueDelegate)];
|
||||
[[delegateMock expect] requestQueueDidBeginLoading:queue];
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*) delegateMock;
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*)delegateMock;
|
||||
NSURL* URL = [RKTestFactory baseURL];
|
||||
RKRequest* request = [[RKRequest alloc] initWithURL:URL];
|
||||
[queue addLoadingRequest:request];
|
||||
@@ -113,7 +113,7 @@
|
||||
RKRequestQueue* queue = [RKRequestQueue new];
|
||||
OCMockObject* delegateMock = [OCMockObject niceMockForProtocol:@protocol(RKRequestQueueDelegate)];
|
||||
[[delegateMock expect] requestQueueDidFinishLoading:queue];
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*) delegateMock;
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*)delegateMock;
|
||||
NSURL* URL = [RKTestFactory baseURL];
|
||||
RKRequest* request = [[RKRequest alloc] initWithURL:URL];
|
||||
[queue addLoadingRequest:request];
|
||||
@@ -132,7 +132,7 @@
|
||||
request.delegate = loader;
|
||||
|
||||
RKRequestQueue* queue = [RKRequestQueue new];
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*) delegateMock;
|
||||
queue.delegate = (NSObject<RKRequestQueueDelegate>*)delegateMock;
|
||||
[[delegateMock expect] requestQueueDidFinishLoading:queue];
|
||||
[queue addRequest:request];
|
||||
[queue start];
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
assertThatInt([[[result1 valueForKeyPath:@"number"] valueForKey:@"text"] intValue], is(equalToInt(1)));
|
||||
assertThat([result1 valueForKeyPath:@"string"], is(equalTo(@"string")));
|
||||
id result2 = [records objectAtIndex:1];
|
||||
assertThatInt([[[result2 valueForKeyPath:@"another-number"] valueForKey:@"text"]intValue], is(equalToInt(1)));
|
||||
assertThatInt([[[result2 valueForKeyPath:@"another-number"] valueForKey:@"text"] intValue], is(equalToInt(1)));
|
||||
}
|
||||
|
||||
- (void)testShouldMapXML {
|
||||
|
||||
Reference in New Issue
Block a user