Coder Social home page Coder Social logo

coredata-hs's People

Contributors

tlewisii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coredata-hs's Issues

Clearification in the README

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.

Checking for the existence of an error

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 generated code does not compile

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.

Between is misspelled

+ (NSArray *)timeStampIsBetwixt:(id)object inContext:(NSManagedObjectContext *)context sortDescriptors:(NSArray *)sort error:(void(^)(NSError *error))errorBlock;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.