Skip to content

Commit

Permalink
Some code formatting cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawwad committed Sep 2, 2012
1 parent 8cbdb5f commit 285586a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Code/CoreData/RKEntityByAttributeCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ - (BOOL)shouldCoerceAttributeToString:(NSString *)attributeValue
- (void)load
{
RKLogDebug(@"Loading entity cache for Entity '%@' by attribute '%@' in managed object context %@ (concurrencyType = %ld)",
self.entity.name, self.attribute, self.managedObjectContext, (unsigned long) self.managedObjectContext.concurrencyType);
self.entity.name, self.attribute, self.managedObjectContext, (unsigned long)self.managedObjectContext.concurrencyType);
@synchronized(self.attributeValuesToObjectIDs) {
self.attributeValuesToObjectIDs = [NSMutableDictionary dictionary];

Expand Down
2 changes: 1 addition & 1 deletion Code/CoreData/RKInMemoryManagedObjectCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (NSArray *)findInstancesOfEntity:(NSEntityDescription *)entity
RKLogInfo(@"Caching instances of Entity '%@' by primary key attribute '%@'", entity.name, primaryKeyAttribute);
[self.entityCache cacheObjectsForEntity:entity byAttribute:primaryKeyAttribute];
RKEntityByAttributeCache *attributeCache = [self.entityCache attributeCacheForEntity:entity attribute:primaryKeyAttribute];
RKLogTrace(@"Cached %ld objects", (long) [attributeCache count]);
RKLogTrace(@"Cached %ld objects", (long)[attributeCache count]);
}

return [self.entityCache objectsForEntity:entity withAttribute:primaryKeyAttribute value:primaryKeyValue inContext:managedObjectContext];
Expand Down
2 changes: 1 addition & 1 deletion Code/ObjectMapping/RKConnectionMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@class RKConnectionMapping, RKDynamicMappingMatcher;
@protocol RKManagedObjectCaching;

typedef id(^RKObjectConnectionBlock)(RKConnectionMapping *mapping, id source);
typedef id (^RKObjectConnectionBlock)(RKConnectionMapping *mapping, id source);

// Defines the rules for connecting relationsips
/**
Expand Down
2 changes: 1 addition & 1 deletion Code/ObjectMapping/RKConnectionMapping.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ @interface RKForeignKeyConnectionMapping : RKConnectionMapping
@interface RKKeyPathConnectionMapping : RKConnectionMapping
@end

@interface RKConnectionMapping()
@interface RKConnectionMapping ()
@property (nonatomic, strong, readwrite) NSRelationshipDescription *relationship;
@property (nonatomic, strong, readwrite) NSString *sourceKeyPath;
@property (nonatomic, strong, readwrite) NSString *destinationKeyPath;
Expand Down
2 changes: 1 addition & 1 deletion Code/Search/RKSearchTokenizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ - (NSSet *)tokenize:(NSString *)string
CFStringTokenizerRef tokenizer = CFStringTokenizerCreate(kCFAllocatorDefault, (__bridge CFStringRef)tokenizeText, CFRangeMake(0, CFStringGetLength((__bridge CFStringRef)tokenizeText)), kCFStringTokenizerUnitWord, locale);
CFStringTokenizerTokenType tokenType = kCFStringTokenizerTokenNone;

while(kCFStringTokenizerTokenNone != (tokenType = CFStringTokenizerAdvanceToNextToken(tokenizer))) {
while (kCFStringTokenizerTokenNone != (tokenType = CFStringTokenizerAdvanceToNextToken(tokenizer))) {
CFRange tokenRange = CFStringTokenizerGetCurrentTokenRange(tokenizer);

NSRange range = NSMakeRange(tokenRange.location, tokenRange.length);
Expand Down
4 changes: 2 additions & 2 deletions Code/Support/RKDotNetDateFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ - (BOOL)getObjectValue:(id *)outValue forString:(NSString *)string errorDescript
return (date != nil);
}

- (NSString *) stringForObjectValue:(id)value
- (NSString *)stringForObjectValue:(id)value
{
NSParameterAssert([value isKindOfClass:[NSDate class]]);
NSString *timeZoneOffset = [super stringForObjectValue:value];
NSTimeInterval milliseconds = millisecondsFromSeconds([(NSDate*)value timeIntervalSince1970]);
NSTimeInterval milliseconds = millisecondsFromSeconds([(NSDate *)value timeIntervalSince1970]);
return [NSString stringWithFormat:@"/Date(%1.0lf%@)/", milliseconds, timeZoneOffset];
}

Expand Down
3 changes: 2 additions & 1 deletion Examples/RKSearchExample/RKSearchExample/RKSAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
@"last_name": @"lastName",
@"email_adddress": @"emailAddress",
@"phone_number": @"phoneNumber",
@"notes": @"notes" }];
@"notes": @"notes"
}];

// Configure search indexing
[managedObjectStore addSearchIndexingToEntityForName:@"Contact"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)testShouldHaveKeysAndValuesDictionaryInitializer

- (void)testShouldEncodeUnicodeStrings
{
NSString *unicode = [NSString stringWithFormat:@"%CNo ser ni%Co, ser b%Cfalo%C%C", (unichar) 0x00A1, (unichar) 0x00F1, (unichar) 0x00FA, (unichar) 0x2026, (unichar) 0x0021];
NSString *unicode = [NSString stringWithFormat:@"%CNo ser ni%Co, ser b%Cfalo%C%C", (unichar)0x00A1, (unichar)0x00F1, (unichar)0x00FA, (unichar)0x2026, (unichar)0x0021];
NSDictionary *dictionary = [NSDictionary dictionaryWithObject:unicode forKey:@"utf8"];
NSString *validUnicode = @"utf8=%C2%A1No%20ser%20ni%C3%B1o%2C%20ser%20b%C3%BAfalo%E2%80%A6%21";
assertThat([dictionary stringWithURLEncodedEntries], is(equalTo(validUnicode)));
Expand Down

0 comments on commit 285586a

Please sign in to comment.