Is it possible to have a CBLModel property that is not added to the database?

I would like to have a property on my CBLModel derived class that does not get added to the database. Is it possible to communicate to the framework that a property should not be persisted?

Sure, just don’t declare it @dynamic.

1 Like

That simple :blush:

Or alternatively leave @dynamic and create a setter and getter that do not call super?

@dynamic just tells the compiler “don’t complain if there’s no getter or setter”. So if you provide those methods, you may as well leave off @dynamic.

The hookup to the persistent storage is made when the Obj-C runtime fails to find a method for the getter or setter, and asks the CBLModel implementation to provide one. It creates a method that accesses the document property.

Thanks for the explanation, that makes sense.