tlewisii / coredata-hs Goto Github PK
View Code? Open in Web Editor NEWCore Data fetch requests, created for you.
License: MIT License
Core Data fetch requests, created for you.
License: MIT License
Upon initially reading the README it wasn't clear what methods would be automatically generated. Would only properties with a title of "name" be generated or are fetch request for all properties of a model created for you?
I think if you showed an example model first, say a Person
object, and then showed what methods would be generated for said object it would be clearer to me.
Instead of if(err && error) {
wouldn't it be better to check if the returned results array isn't nil
? For example:
+ (NSArray *)nameIsEqualTo:(id)object inContext:(NSManagedObjectContext *)context sortDescriptors:(NSArray *)sort error:(void(^)(NSError *error))error {
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"TJLSuperEntity"];
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"name = %@", object]];
[fetchRequest setSortDescriptors:sort];
NSError *err = nil;
NSArray *results = [context executeFetchRequest:fetchRequest error:&err];
if(!results && error) {
error(err);
return nil;
}
return results;
}
I was under the impression that you can't gurantee err
is a valid object.
The tool produced code like this:
+ (NSArray *)timeStampIsEqualTo:(id)object inContext:(NSManagedObjectContext *)context sortDescriptors:(NSArray *)sort error:(void(^)(NSError *error))errorBlock {
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"WFForecast"];
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"timeStamp = %@", object]];
[fetchRequest setSortDescriptors:sort];
NSError *err = nil;
NSArray *results = [context executeFetchRequest:fetchRequest error:&err];
if(!result && errorBlock) {
errorBlock(err);
return nil;
}
return results;
}
It is checking for a if(!result && errorBlock)
but result
doesn't exist. It should be results
, note the plurality.
+ (NSArray *)timeStampIsBetwixt:(id)object inContext:(NSManagedObjectContext *)context sortDescriptors:(NSArray *)sort error:(void(^)(NSError *error))errorBlock;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.