Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Out-of-box document-level do not delete support for table rows #63

Open
pulkitsinghal opened this issue Feb 3, 2013 · 1 comment
Open

Comments

@pulkitsinghal
Copy link

I often run into use cases where I need to pre-populate a fake document in order to simulate a row of data in my table view (built using CouchUITableSource):
a) either, because I want to show the user what sort of interaction they can have with the given view,
b) or, because the table row is actually an action siting with the rest of the data rows, which seems to be a popular way to work these days (Any.Do app)

I have written a very simple patch which allows developers to provide CouchUITableSource with a property doNotDeleteProperty and gain document-level control over which rows may or may not be deleted.

https://gist.github.com/4702055

If my document model has the property -[CouchModel setMustStickAround:] then:
a) setting that to true on only the objects that should NOT be deleted, and
b) letting CouchCocoa know about which property to monitor -[CouchUITableSource setDoNotDeleteProperty:@"mustStickAround"] ... will do the job.

@snej
Copy link
Contributor

snej commented Feb 4, 2013

This sounds good, but I'm at the point now where I'm trying to keep the size of the core code down (it's getting near 500k on iOS.) Maybe you could refactor this into a subclass, and we could publish this somewhere as an optional extension people could add to their app projects?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants