Mac Developer Library

Developer

PSContent Class Reference

Options
Deployment Target:

On This Page

PSContent

Inheritance


Conforms To


Import Statement


Not Applicable

Objective-C

@import PubSub;

Availability


Available in OS X v10.5 and later.
Deprecated in OS X v10.9.

A PSContent object contains the description from an entry. The entry's description is usually a plain text string or an HTML string, although it is allowed to be any data type. PSContent provides accessor methods for retrieving the content information as either plain text, HTML formatted text or an NSData object. Both summaries and entries are represented as content objects. It is not recommended that you subclass PSContent.

  • plainTextString plainTextString (OS X v10.9) Property

    A plain text representation of the content. (read-only)

    Declaration

    Objective-C

    @property(readonly) NSString *plainTextString

    Discussion

    If the original MIME type is HTML, tags are removed and entities decoded. Additionally, minimal formatting is applied, such as line breaks between HTML blocks. If the content is nontextual, this method returns nil.

    Import Statement

    Objective-C

    @import PubSub;

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.9.

  • MIMEType MIMEType (OS X v10.9) Property

    The MIME type of the content. (read-only)

    Declaration

    Objective-C

    @property(readonly, retain) NSString *MIMEType

    Discussion

    The MIME type returned is in the format text/html or text/plain.

    Import Statement

    Objective-C

    @import PubSub;

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.9.

  • HTMLString HTMLString (OS X v10.9) Property

    An HTML representation of the content. (read-only)

    Declaration

    Objective-C

    @property(readonly, retain) NSString *HTMLString

    Discussion

    The string returned is an HTML fragment corresponding to the content, not the entire document. To display it, you would typically set this as the innerHTML of a DIV element. If the original MIME type is HTML, the content will have been "tidied" to fix common problems such as unclosed tags and to remove elements such as SCRIPT. If the original MIME type is plain text, then HTML metacharacters will be escaped. If the content is non-textual, this method returns nil.

    Import Statement

    Objective-C

    @import PubSub;

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.9.

  • data data (OS X v10.9) Property

    The raw data representation of the content. (read-only)

    Declaration

    Objective-C

    @property(readonly, retain) NSData *data

    Import Statement

    Objective-C

    @import PubSub;

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.9.