Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
8 Source/CWSerialBlockQueue.m
@@ -111,11 +111,9 @@ -(void)addBlockOperation:(CWSerialBlockOperation *)operation {
}
-(void)addBlockOperationObjects:(NSArray *)operationObjects {
- if (operationObjects && ([operationObjects count] > 0)) {
- for (id op in operationObjects) {
- if ([op isMemberOfClass:[CWSerialBlockOperation class]]) {
- [self addBlockOperationObjects:op];
- }
+ for (id op in operationObjects) {
+ if ([op isMemberOfClass:[CWSerialBlockOperation class]]) {
+ [self addBlockOperationObjects:op];
}
}
}
View
4 Source/NSManagedObjectAdditions.m
@@ -51,8 +51,8 @@ -(BOOL)cw_setValue:(id)value
}
-(void)cw_setValuesForKeys:(NSDictionary *)moValues {
- [moValues cw_each:^(id key, id value, BOOL *stop) {
- [self setValue:value forKey:key];
+ [moValues enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+ [self setValue:obj forKey:key];
}];
}
View
19 Source/NSManagedObjectContextAdditions.m
@@ -28,6 +28,7 @@ of this software and associated documentation files (the "Software"), to deal
*/
#import "NSManagedObjectContextAdditions.h"
+#import <objc/runtime.h>
@implementation NSManagedObjectContext (CWNSManagedObjectContextAdditions)
@@ -36,16 +37,18 @@ @implementation NSManagedObjectContext (CWNSManagedObjectContextAdditions)
static void *cwmdbg = &cwmdbg;
-(NSString *)cw_debugName {
- return [self cw_valueAssociatedWithKey:cwmdbg];
+ return objc_getAssociatedObject(self, cwmdbg);
}
-(void)cw_setDebugName:(NSString *)cwdebugname {
- [self cw_associateValue:cwdebugname
- withKey:cwmdbg];
+ objc_setAssociatedObject(self,
+ cwmdbg,
+ cwdebugname,
+ OBJC_ASSOCIATION_RETAIN);
}
-(void)cw_logObjectsInContext {
- if ([self cw_debugName]) {
+ if (self.cw_debugName) {
NSLog(@"MOC Name: %@",[self cw_debugName]);
} else {
NSLog(@"MOC: %@",[self description]);
@@ -53,10 +56,10 @@ -(void)cw_logObjectsInContext {
NSLog(@"Has Changes: %@",(self.hasChanges ? @"YES" : @"NO"));
- if ([self hasChanges]) {
- if ([[self insertedObjects] count] > 0) NSLog(@"%lu Inserted Objects",(long)[[self insertedObjects] count]);
- if ([[self updatedObjects] count] > 0) NSLog(@"%lu Updated Objects",(long)[[self updatedObjects] count]);
- if ([[self deletedObjects] count] > 0) NSLog(@"%lu Deleted Objects",(long)[[self deletedObjects] count]);
+ if (self.hasChanges) {
+ if (self.insertedObjects.count > 0) NSLog(@"%lu Inserted Objects",(long)self.insertedObjects.count);
+ if (self.updatedObjects.count > 0) NSLog(@"%lu Updated Objects",(long)self.updatedObjects.count);
+ if (self.deletedObjects.count > 0) NSLog(@"%lu Deleted Objects",(long)self.deletedObjects.count);
}
}

No commit comments for this range

Something went wrong with that request. Please try again.