< Previous PageNext Page > Hide TOC

Enabling Editing

By setting the editable attribute of a WebView object you can make all the web content displayed in that view editable. Editing the content will change the underlying Document Object Model (DOM). However, setting the editable attribute to YES does not modify the editing attributes of the DOM objects—the WebView attribute setting overrides the DOM attributes.

For example, to modify the MiniBrowser application located in /Developer/Examples/WebKit, set the editable attribute to YES after the nib file is loaded in MyDocument’s windowControllerDidLoadNib: method as follows:

- (void)windowControllerDidLoadNib:(NSWindowController *) aController
{
    [super windowControllerDidLoadNib:aController];
    ...
    // Set editable flag
    [webView setEditable:YES];
}

Now when you build and run the application, you can add, delete, and modify the HTML content displayed in a WebView object. See “Saving and Loading Web Content” for how to get the HTML source from the DOM.



< Previous PageNext Page > Hide TOC


© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.