Changed type of default batch size to NSUInteger, fixed logging

This commit is contained in:
Saul Mora
2011-02-15 09:41:02 -07:00
parent 2bbf4c68f5
commit 4627257e43
2 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
#ifdef ENABLE_ACTIVE_RECORD_LOGGING
#define ARLog(...) NSLog(@"%s(%x) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#else
#define ARLog(...)
#define ARLog(...) ((void)0)
#endif
#import "ActiveRecordHelpers.h"

View File

@@ -8,26 +8,26 @@
#import "NSManagedObjectContext+ActiveRecord.h"
static NSNumber *defaultBatchSize = nil;
static NSUInteger defaultBatchSize = kActiveRecordDefaultBatchSize;
@implementation NSManagedObject (ActiveRecord)
+ (void) setDefaultBatchSize:(NSUInteger)newBatchSize
{
@synchronized(defaultBatchSize)
@synchronized(self)
{
defaultBatchSize = [NSNumber numberWithInt:newBatchSize];
defaultBatchSize = newBatchSize;
}
}
+ (NSInteger) defaultBatchSize
+ (NSUInteger) defaultBatchSize
{
if (defaultBatchSize == nil)
{
[self setDefaultBatchSize:kActiveRecordDefaultBatchSize];
}
return [defaultBatchSize integerValue];
return defaultBatchSize;
}
+ (void) handleErrors:(NSError *)error