Mac Developer Library

Developer

PSEntry Class Reference

Options
Deployment Target:

On This Page
Language:

PSEntry

A PSEntry is an entry in a feed object. Entry objects are acquired from the associated feed object.

Most of the attributes for an entry are defined by the RSS 2.0 and Atom 1.0 specs. Any attributes defined by those specs (or nonstandard extensions) that are not natively supported by PSEntry can be retrieved from the entry objects' XMLRepresentation property.

Some PSEntry attributes are specific to the local copy of the entry, such as isRead and receivedDate.

Since the values of the RSS and Atom attributes are derived from data received from the server, they may be missing or incorrect. If you have the opportunity, use attributes generated by the Publication Subscription framework, as it is more reliable. For example, using updatedDate to find entries that have been modified since a certain time would be unreliable. Use receivedDate instead. It is not recommended that you subclass PSEntry.

  • Returns an array of the extension XML elements that are outside of the RSS or Atom standards.

    Declaration

    - (NSArray *) extensionXMLElementsUsingNamespace:(NSString *)nameSpace;

    Parameters

    nameSpace

    The extension XML elements you want to receive. Pass nil to get all extension XML elements, regardless of their namespace.

    Return Value

    An array containing the extension XML elements requested. Make sure to pass a namespace and not a namespace prefix for the nameSpace parameter. For example, to retrieve the iTunes Podcast elements, use extensionXMLElementsUsingNamespace:@"http://www.itunes.com/dtds/podcast-1.0.dtd", not extensionXMLElementsUsingNamespace:@"itunes".

    This method attempts to communicate with the PubSubAgent process and causes the agent to launch if it is not already running. If PubSubAgent cannot be contacted, an exception will be thrown with the name PSException. To avoid problems, you should always be prepared to catch an exception thrown by this method.

  • The raw XML entry. (read-only)

    Declaration

    @property (readonly) NSXMLElement * XMLRepresentation;

    Discussion

    The raw XML is parsed into a DOM tree, and the <entry> or <article> element is returned.

  • A string to display as the entry's title. (read-only)

    Declaration

    @property (readonly) NSString * titleForDisplay;

    Discussion

    This property returns up to the first 100 characters of the entry's summary, or content if there is no summary.

  • title Property

    The entry's title. (read-only)

    Declaration

    @property (readonly, retain) NSString * title;

    Discussion

    Corresponds to the element in both Atom and RSS.

  • summary Property

    A string that contains the entry's summary. (read-only)

    Declaration

    @property (readonly, retain) PSContent * summary;

    Discussion

    Corresponds to the <summary> element in Atom. There is no RSS equivalent.

  • rights Property

    The entry's copyright information. (read-only)

    Declaration

    @property (readonly, retain) NSString * rights;

    Discussion

    Corresponds to the <rights> element in Atom. There is no RSS equivalent.

  • read Property

    A Boolean value indicating whether or not the entry is read.

    Declaration

    @property (getter=isRead, setter=setRead:) BOOL read;

    Discussion

    Read status of an article is shared among all applications using the Publication Subscription framework. By default, this method returns NOfalse.

  • The date when the entry was updated in the local Publication Subscription database. (read-only)

    Declaration

    @property (readonly, retain) NSDate * localDateUpdated;

  • The date when the entry was created in the local Publication Subscription database. (read-only)

    Declaration

    @property (readonly, retain) NSDate * localDateCreated;

  • identifier Property

    A string that uniquely identifies an entry. (read-only)

    Declaration

    @property (readonly, retain) NSString * identifier;

    Discussion

    This identifier can be used as a key to map between PSEntry objects and your application's own data model objects. This identifier is generated internally by the Publication Subscription framework by combining the identifier of the feed with the 'most unique' attribute of the entry. You should not make any assumptions about its format or size, as they may change. (Although Atom defines a mandatory <id> element, it cannot be used for this purpose since the RSS equivalent (<guid>) is optional. Thus, Publication Subscription uses its own mechanism for uniquely identifying entries. Clients can manually parse the XMLRepresentation output if they need the Atom <id> element or RSS <guid> element.)

  • flagged Property

    A Boolean value indicating whether or not the entry is flagged.

    Declaration

    @property (getter=isFlagged, setter=setFlagged:) BOOL flagged;

    Discussion

    Flagged status of an article is shared among all applications using the Publication Subscription framework. By default, this method returns NOfalse.

  • feed Property

    The feed the receiver belongs to. (read-only)

    Declaration

    @property (readonly) PSFeed * feed;

  • enclosures Property

    An array of enclosure objects of the enclosures of an entry. (read-only)

    Declaration

    @property (readonly, retain) NSArray * enclosures;

    Discussion

    The enclosures correspond to the element in Atom and the <enclosure> element in RSS. The order of the enclosure objects returned is undefined. }

  • dateUpdated Property

    The date that the entry was last modified. (read-only)

    Declaration

    @property (readonly, retain) NSDate * dateUpdated;

    Discussion

    The return value corresponds to the <updated> elements in Atom. There is no RSS equivalent. To get the local date and time that the latest update was received by the user's machine, use the localDateUpdated method.

  • The date that the entry was published. (read-only)

    Declaration

    @property (readonly, retain) NSDate * datePublished;

    Discussion

    The return value corresponds to the <published> element in Atom and the <pubDate> element in RSS.

  • A guaranteed non-nil date for the entry, suitable for displaying or sorting. (read-only)

    Declaration

    @property (readonly, retain) NSDate * dateForDisplay;

    Discussion

    This returns the entry's datePublished if available, otherwise the dateUpdated; if neither appears in the feed, it falls back on the localDateCreated. Use this method if you need a guaranteed non-nil date, as in sorting or displaying in a table column.

  • dateCreated Property

    The date that the entry was created. (read-only)

    Declaration

    @property (readonly, retain) NSDate * dateCreated;

    Discussion

    The date corresponds to the <dc:created> element in Dublin Core (http://dublincore.org/). There is no Atom nor RSS equivalent. When it exists, this date is set by either the author's blogging software or the server and is stored in the feed. It may be earlier than datePublished if the entry was not immediately published after being written. To get the local date and time when the entry was received by the user's machine, use the locateDateCreated method instead.

  • current Property

    A Boolean value indicating whether an entry still appears in its feed. (read-only)

    Declaration

    @property (readonly, getter=isCurrent) BOOL current;

    Discussion

    Typically, a feed contains 10-15 entries at a time, so as a new entry is added, the oldest entry "falls off." If the property returns NO, the entry has 'fallen off the bottom' of the feed but is still in the PubSub Database.

  • An array of author objects that contains the entry's contributors. (read-only)

    Declaration

    @property (readonly, retain) NSArray * contributors;

    Discussion

    Corresponds to the <contributor> element in Atom. There is no RSS equivalent.

  • content Property

    The content of the entry. (read-only)

    Declaration

    @property (readonly, retain) PSContent * content;

    Discussion

    Corresponds to the <content> element in Atom and <description> in RSS.

  • baseURL Property

    The base URL for resolving relative links.(read-only)

    Declaration

    @property (readonly, retain) NSURL * baseURL;

    Discussion

    The returned URL corresponds to the xml:base attribute on an Atom <entry> element or an RSS <item> element. Publication Subscription resolves all parsed URLs to be absolute. However, this is not possible for URLs embedded within an entry's content or summary. If a client chooses to display content in HTML form, the base URL must be set for relative URLs to work.Note: Atom technically allows the xml:base attribute to appear as an attribute of the <content> or <summary> elements. In practice, this seldom occurs. A client may choose to parse these xml:base attributes manually via XMLRepresentation.

  • The authors of the entry as a string. (read-only)

    Declaration

    @property (readonly) NSString * authorsForDisplay;

    Discussion

    If there are multiple authors, they are comma-delimited.

  • authors Property

    An array of author objects representing the entry's authors. (read-only)

    Declaration

    @property (readonly, retain) NSArray * authors;

    Discussion

    The authors correspond to the <author> element in Atom and RSS. This method currently only supports a single author, the first one.

  • The URL to an alternate version of the entry resource. (read-only)

    Declaration

    @property (readonly, retain) NSURL * alternateURL;

    Discussion

    Traditionally, the alternate URL corresponds to the HTML version of an entry. The URL is parsed from the element in Atom and the <hd_link posstarget="element in RSS. This URL is often called a permalink."> element in RSS. This URL is often called a permalink. }