I'm a newbie trying out a web-browser app, using WebKit with the NSDocument architecture (as in some of the WebKit reference code). I have it opening a pre-set home page, then post the current URL to an adjacent text field, then have the WebView open an URL entered into the text field, and then I changed it to load in local files. I did that using the existing NSDocument file-opening code: I override the URL and NSData opening methods to cache both of those (inside the document object), then at XIB-creation time I pass those attributes to the WebView.
It seems to work, but there's been weirdness. I've been trying to work around it, but I think I need a re-think. I finally realized that the local file is still the flagged by the NSDocument architecture even when I change the web page (with the text field) away from the local file. I think I need to "import" the local file instead of "open." One way is to de-certify the file from internal tracking after loading it. The other way is to do a non-tracking read to begin with. Which way is best? And how can I do it in the NSDocument architecture?