MTPopupWindow icon indicating copy to clipboard operation
MTPopupWindow copied to clipboard

Fix view of content from local files

Open felixkirathe opened this issue 11 years ago • 0 comments

in the showInView function add below.

else if ([self.fileName hasPrefix:@"/"]) { //load a local file NSError* error = nil;

    NSString* fileAtPath = self.fileName;

    NSString* fileContents = [NSString stringWithContentsOfFile:fileAtPath encoding:NSUTF8StringEncoding error: &error];

    if (error!=NULL) {
        NSLog(@"error loading %@: %@", self.fileName, [error localizedDescription]);
    } else {
        [self.webView loadHTMLString: fileContents baseURL:[[NSBundle mainBundle] resourceURL]];
    }

felixkirathe avatar Aug 08 '14 07:08 felixkirathe