I have a document-based application (several documents, each of which has its own permanent data storage). I am using UIManagedDocument to develop it.
Each document is a drawing, and I want to keep a preview ( UIImage ) of each drawing.
As I want to show scrollView with all the previews, I think I should not put the preview inside the database, so I use the UIManagedDocument supplemental content UIManagedDocument as described.
I have a couple of questions:
What use does the parameter "absoluteURL" have in additionalContentForURL:error: :? This is not used in the example I'm connected.
How to get a preview without opening a document? At the moment I am doing this:
.
NSString* docName = [[[DocumentStore sharedStore] documentsList] objectAtIndex:indexPath.row]; NSString* dataDirectory = [FileUtils privateDataDirectory]; NSString *dataPath = [dataDirectory stringByAppendingPathComponent:docName]; NSString *imagePath = [dataPath stringByAppendingPathComponent:@"AdditionalContent/thumb.png"]; UIImage * preview = [UIImage imageWithContentsOfFile:imagePath];
... but I'm not sure if this is the best way to do this.
source share