That @"Library" should be the absolute path of the Library
folder, which for the simulator is more or less something like
this @"/Users/yourusername/Library/Application Support/iPhone
(on the device is similar, but not the same). Supposing that you
want to put a video.mp4 and a audio.mp3 files in the "Library" path
and you have added them to your project (that is, in the bundle).
The annotations url will be fpkv://video.mp4, etc (no
intermediate folder since they will be placed directly into the
Utility method to get the library path.
NSArray * paths = NSSearchPathForDirectoriesInDomains(
NSLibraryDirectory, NSUserDomainMask, YES); // Array of paths
NSString *libraryPath = [paths objectAtIndex:0]; // The absolute path of the Library directory on both sim and device
Self explicative method name.
NSFIleManager * fileManager = [NSFileManager defaultManager];
// Check the video file (omitted error handling)
NSString * fileToCheck = [MyClass libraryPath] stringByAppendingPathComponent:@"video.mp4"];
if( ! [fileManager itemExistAtPath:fileToCheck isDirectory:NULL])
// Copy the video.mp4 from the bundle to the fileToCheck path
NSString * srcPath = [[NSBundle mainBundle]pathForResource:@"video.mp4" ofType:nil];
[fileManager copyItemAtPath:srcPath toPath:fileToCheck error:NULL];
/* Do the same for the other files */
Method invoked to open the document.
MFDocumentManager * manager = ...
manager.resourceFolder = [MyClass libraryPath];
ReaderViewController * controller = ...