Search code examples
iosdbaccess

DBAccess v1.6.2 initWithPrimaryKeyValue returns nil


I'm trying to init entity with id.

User *user = [[User alloc] initWithPrimaryKeyValue:userID];

And it always returns nil, if there is no entity in database with this ID. But documentations says it should return a new object with userID primary key. What's wrong?


Solution

  • Thanks for finding/pointing out the bug. This has now been fixed in version 1.06.4, which can be downloaded here.

    http://www.db-access.org/downloads

    Our automated testing only seemed to test existing objects, so we have now expanded to include all aspects of retrieving and also a full persistence lifecycle for those objects.

    We have also added a method,

    + (id)objectWithPrimaryKeyValue:(NSObject*)priKeyValue;
    

    Which works exactly as the buggy version of init did, just in case anyone wants that kind of feature.

    Sorry for the inconvenience.

    You can always email devs@db-access.org to report bugs or suggest enhancements if it is quicker for you.