Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

WebArchive Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/WebKit.framework
Availability
Available in Mac 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
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
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
Declared In
WebArchive.h

mainResource

Returns the receiver’s main resource.

- (WebResource *)mainResource

Availability
Declared In
WebArchive.h

subframeArchives

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

- (NSArray *)subframeArchives

Availability
See Also
Declared In
WebArchive.h

subresources

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

- (NSArray *)subresources

Availability
See Also
Declared In
WebArchive.h

Constants

Constants used with the pasteboard:

Constant

Description

WebArchivePboardType

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



Next Page > Hide TOC


Last updated: 2006-05-23




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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice