WebArchive Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/WebKit.framework
Availability
Available in OS X v10.3.9 and later.
Companion guide
Declared in
WebArchive.h

Overview

A WebArchive object represents a webpage that can be archived—for example, archived on disk or on the pasteboard. A WebArchive object contains the main resource, as well as the subresources and subframes of the main resource. The main resource can be an entire webpage, a portion of a webpage, or some other kind of data such as an image. Use this class to archive webpages, or place a portion of a webpage on the pasteboard, or to represent rich web content in any application.

Tasks

Initializing

Getting Attributes

Instance Methods

data

Returns the data representation of the receiver.

- (NSData *)data
Discussion

The data returned can be used to save the web archive to a file, to put it on the pasteboard using the WebArchivePboardType type, or used to initialize another web archive using the initWithData: method.

Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

initWithData:

Initializes and returns the receiver, specifying the initial content data.

- (id)initWithData:(NSData *)data
Discussion

Use the data method to get the receiver’s data.

Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

initWithMainResource:subresources:subframeArchives:

Initializes the receiver with a resource and optional subresources and subframe archives..

- (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives
Discussion

This method initializes and returns the receiver by setting the main resource to mainResource, and setting the subresources and subframe archives if supplied. The subresources argument should be an array of WebResource objects or nil if none are specified. The subframeArchives should be and array of WebArchive objects used by the subframes or nil if none are specified.

Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

mainResource

Returns the receiver’s main resource.

- (WebResource *)mainResource
Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

subframeArchives

Returns archives representing the receiver’s subresources or nil if there are none.

- (NSArray *)subframeArchives
Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

subresources

Returns the receiver’s subresources, or nil if there are none.

- (NSArray *)subresources
Availability
  • Available in OS X v10.3.9 and later.
Declared In
WebArchive.h

Constants

WebArchivePboardType

The pasteboard type for this class.

extern NSString *WebArchivePboardType;
Constants
WebArchivePboardType

The pasteboard type constant used when adding or accessing a WebArchive on the pasteboard.

Available in OS X v10.3 and later.

Declared in WebArchive.h.