SQLitePersistentObjects are now working!

By farcaller December 18th, 2008

I’ve did a port of SQLitePersistentObjects to Cocotron, and now it’s part of libFOW (enabled via BUILD_SQLITEPO option).

Cocotron’s Obj-C runtime doesn’t support properties introspection, so for each descendant of SQLitePersistentObject you must define following selector:

+ (NSArray *)getPropertiesList;

It must return an array of all properties in form of NSArrays with two items: property name and encoded type:

+ (NSArray *)getPropertiesList
{
        return [NSArray arrayWithObjects:
                [NSArray arrayWithObjects:@"name", @"@\"NSString\"", nil],
                [NSArray arrayWithObjects:@"favoriteInt", @"i", nil],
                [NSArray arrayWithObjects:@"birthDate", @"@\"NSDate\"", nil],
        nil];
}

You can get full list of types either from SQLitePersistentObject.h or Cocoa documentation.

This entry was posted on Thursday, December 18th, 2008 at 15:27 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply