Inherits from NSObject
Conforms to NSKeyedUnarchiverDelegate
Declared in DTWebResource.h

Overview

A DTWebResource 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 DTWebResource object. Use the other methods in this class to get the properties of a DTWebResource object.

Methods for extenting DTWebResource for use with DTRichTextEditor.

Instance Methods

MIMEType

Returns the receiver’s MIME type.

- (NSString *)MIMEType

Return Value

The MIME type of the data.

Declared In

DTWebResource.h

URL

Returns the receiver’s URL.

- (NSURL *)URL

Return Value

The download URL.

Declared In

DTWebResource.h

data

Returns the receiver’s data.

- (NSData *)data

Return Value

The download data.

Declared In

DTWebResource.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.

Declared In

DTWebResource.h

image

Convenience method to retrieve the image represented by the receiver.

- (UIImage *)image

Return Value

The image or nil if the receiver is not an image.

Declared In

DTWebResource+DTRichText.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.

Declared In

DTWebResource.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.

Declared In

DTWebResource.h