userProperties for CBLModels?

47 views
Skip to first unread message

Todd Freese

unread,
Jun 6, 2014, 12:44:27 AM6/6/14
to mobile-c...@googlegroups.com
Is there a way to get all the user properties for a CBLModel? Including any that are nil?

Calling userProperties on the document of a CBLModel does not return any properties that are nil.

I need to loop over all the properties in a CBLModel when if the property is nil.

Todd

Jens Alfke

unread,
Jun 6, 2014, 6:49:24 PM6/6/14
to mobile-c...@googlegroups.com

On Jun 5, 2014, at 9:44 PM, Todd Freese <to...@filmworkers.com> wrote:

Is there a way to get all the user properties for a CBLModel? Including any that are nil?

Hm, I don’t think there is. You’d probably need to use the Obj-C runtime API to enumerate all the class’s properties and find the ones marked @dynamic.

—Jens

Todd Freese

unread,
Jun 6, 2014, 7:57:31 PM6/6/14
to mobile-c...@googlegroups.com
Seems like it would be nice to have a method on CBLModel that would return "all" the user properties defined in the model class.

Todd

Jens Alfke

unread,
Jun 7, 2014, 5:25:07 PM6/7/14
to mobile-c...@googlegroups.com

On Jun 6, 2014, at 4:57 PM, Todd Freese <to...@filmworkers.com> wrote:

Seems like it would be nice to have a method on CBLModel that would return "all" the user properties defined in the model class.

File a request as an issue on Github, then :)

—Jens

Todd Freese

unread,
Jun 7, 2014, 6:42:54 PM6/7/14
to mobile-c...@googlegroups.com
Will do.

Thanks Jens,

T
Reply all
Reply to author
Forward
0 new messages