mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 17:32:18 +08:00
Changed type of default batch size to NSUInteger, fixed logging
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user