tomalan / sqlitepersistentobjects

Automatically exported from code.google.com/p/sqlitepersistentobjects
0 stars 0 forks source link

Should return id rather than SQLitePersistentObject to avoid coercion #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
These methods:

+(SQLitePersistentObject *)findFirstByCriteria:(NSString *)criteriaString, ...;
+(SQLitePersistentObject *)findByPK:(int)inPk;

should instead be:

+(id)findFirstByCriteria:(NSString *)criteriaString, ...;
+(id)findByPK:(int)inPk;

to avoid having to coerce them when invoking on subclasses.

As they are now, I need to add messy coercion thusly:

        GroupData *group = (GroupData *)[GroupData findByPK:pk];

to avoid a type warning.  Changing to id would allow:

        GroupData *group = [GroupData findByPK:pk];

Original issue reported on code.google.com by goo...@dejal.com on 13 Mar 2009 at 4:00