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

Would like a simple way to create an attachment for a new document #42

Open
lenkawell opened this issue Sep 13, 2012 · 0 comments
Open

Comments

@lenkawell
Copy link

These two lines of code do not work, but I have yet to find a simple way to create a new document and an attachment.

CouchRevision* revision = [self.database documentWithID:name].currentRevision;
CouchAttachment* attachment = [revision createAttachmentWithName:@"photo" type:@"image/jpeg"];

The problem is that .currentRevision appears to return nil for an new (unsaved) document. I see that CouchModel cheats with a private CouchAttachment.initWithParent:name: metadata: method, so there seems to be a general need to do this.

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

1 participant