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

lenkawell opened this Issue Sep 13, 2012 · 0 comments


None yet

1 participant

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 join this conversation on GitHub. Already have an account? Sign in to comment