WebResource 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
WebResource.h

Overview

A WebResource object represents a downloaded URL. It encapsulates the data of the download as well as other resource properties such as the URL, MIME type, and frame name.

Use the initWithData:URL:MIMEType:textEncodingName:frameName: method to initialize a newly created WebResource object. Use the other methods in this class to get the properties of a WebResource object.

Tasks

Initializing

Getting Attributes

Instance Methods

data

Returns the receiver’s data.

- (NSData *)data
Return Value

The download data.

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

frameName

Returns the receiver’s frame name.

- (NSString *)frameName
Return Value

The name of the frame. If the receiver does not represent the contents of an entire HTML frame, this method returns nil.

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

initWithData:URL:MIMEType:textEncodingName:frameName:

Initializes and returns a web resource instance.

- (id)initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName
Parameters
data

The download data.

URL

The download URL.

MIMEType

The MIME type of the data.

textEncodingName

The IANA encoding name (for example, “utf-8” or “utf-16”). This parameter may be nil.

frameName

The name of the frame. Use this parameter if the resource represents the contents of an entire HTML frame; otherwise pass nil.

Return Value

An initialized web resource.

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

MIMEType

Returns the receiver’s MIME type.

- (NSString *)MIMEType
Return Value

The MIME type of the data.

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

textEncodingName

Returns the receiver’s text encoding name.

- (NSString *)textEncodingName
Return Value

The IANA encoding name (for example, “utf-8” or “utf-16”), or nil if the name does not exist.

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

URL

Returns the receiver’s URL.

- (NSURL *)URL
Return Value

The download URL.

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