magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Fetching fluent style support #1235

Open lolgear opened 8 years ago

lolgear commented 8 years ago

Does MagicalRecord support fluent style for fetching?

plain

[User MR_fetchAllSortedBy:@"created" ascending:NO withPredicate:nil groupBy:nil delegate:self];

fluent

[User MR_fetchAllFluently].sortedBy(@"created").ascending(NO).delegate(self)/*.predicate(nil).groupBy(nil)*/
hardikdevios commented 8 years ago

Nope and its not recommended also or might not possible to do this.

lolgear commented 8 years ago

@hardikdevios could you explain 'awareness' of this method for fetching? You can save these parameters in proxy somewhere inside. Fetch method, for example, start fetching and return correct fetched results controller transfering all parameters into general [User MR_fetchAllSortedBy:@"created" ascending:NO withPredicate:nil groupBy:nil delegate:self]; method.

[User MR_fetchAllFluently].sortedBy(@"created").ascending(NO).delegate(self)/*.predicate(nil).groupBy(nil)*/.fetch;
hardikdevios commented 8 years ago

@lolgear Ok, sortedBy and ascending are passed along with NSFetchedRequest or it will first Fetch then the operation will apply?

hardikdevios commented 8 years ago

@lolgear Ohk i got what your are trying to say and achieve, I have scrolled and at last checked .fetch.Sorry for that but yes i guess somebody needs to work on this its Very cool feature but i have heard that No body is working on dedicatedly on this lib now.But your approach is kind of Reactive 👍