Bug in counting #527

Closed
Fl0p opened this Issue Jul 30, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@Fl0p

Fl0p commented Jul 30, 2013

We have some methods to count Entities
And they use Different Context for counting

+ (NSNumber *) MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm {
    return [self MR_numberOfEntitiesWithPredicate:searchTerm
                                        inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
}
+ (NSUInteger) MR_countOfEntities {
    return [self MR_countOfEntitiesWithContext:[NSManagedObjectContext MR_contextForCurrentThread]];
}
+ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter {
    return [self MR_countOfEntitiesWithPredicate:searchFilter inContext:[NSManagedObjectContext MR_defaultContext]];
}

Need to replace context from MR_defaultContext to MR_contextForCurrentThread in method :
+(NSUinteger) MR_countOfEntitiesWithPredicate:

@casademora

This comment has been minimized.

Show comment Hide comment
@casademora

casademora Aug 26, 2013

Member

MR_contextForCurrentThread will be deprecated. We'll have to figure out a new method to do similar functionality.

Member

casademora commented Aug 26, 2013

MR_contextForCurrentThread will be deprecated. We'll have to figure out a new method to do similar functionality.

@tonyarnold

This comment has been minimized.

Show comment Hide comment
@tonyarnold

tonyarnold Apr 8, 2014

Contributor

Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

Contributor

tonyarnold commented Apr 8, 2014

Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

@tonyarnold tonyarnold closed this Apr 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment