Documentation Bug? #399

Closed
scovetta opened this Issue Jan 26, 2013 · 2 comments

Projects

None yet

3 participants

@scovetta

The initial readme page on Github shows:

NSArray *people = [Person MR_fetchAllWithPredicate:peopleFilter];

Probably should be:

NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
@tonyarnold tonyarnold was assigned Jan 26, 2013
@xanderdunn

This is a good call. The section of the documentation he is referring to:

Returning an NSFetchRequest

NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];

NSArray *people = [Person MR_fetchAllWithPredicate:peopleFilter];

MagicalRecord doesn't even have any methods to return NSFetchRequest, does it? I was going to open a pull request to fix this, but I don't understand the intention of this part of the documentation. I think it would make more sense if the section were titled "Returning an NSFetchedResultsController" that used one of the existing MR_fetch methods.

Alternately, this section could be renamed "Executing an NSFetchRequest" and then reference one of the MR_find methods. However, this wouldn't make sense because the preceding section does exactly that:

Advanced Finding

If you want to be more specific with your search, you can send in a predicate:

NSArray *departments = [NSArray arrayWithObjects:dept1, dept2, ..., nil];
NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];

NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
@tonyarnold
Contributor

It looks like this has been resolved by a documentation cleanup that occurred in 89f13a7. Thanks!

@tonyarnold tonyarnold closed this Aug 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment