RSSArticle Class Reference

`#include <RSSArticle.h>`

Inheritance diagram for RSSArticle:

## Instance Methods

(id) | - init
(id) | - initWithHeadline:url:description:date:
(NSString *) | - headline
(NSString *) | - url
(NSString *) | - content
(NSArray *) | - links
(NSDate *) | - date
(NSURL *) | - enclosure
(void) | - addLink:
(void) | - setLinks:
(void) | - setDate:
(void) | - notifyChange
(BOOL) | - isEqual:
(void) | - willBeReplacedByArticle:
(id) | - initFromStorageWithURL:
(id) | - initWithDictionary:
(BOOL) | - store
(NSMutableDictionary *) | - plistDictionary
Instance Methods inherited from <RSSArticle>
(id< RSSFeed >) | - feed
(void) | - willBeReplacedByArticle:

## Class Methods

(id< RSSMutableArticle >) | + articleFromStorageWithURL:

## Detailed Description

An object of this class represents an article in an RSS Feed.

## Method Documentation

## addLink:

- (void) addLink: |  | (NSURL *) | anURL |

Adds a new link to this article. This is a RSSLink object, which usually has the "type" property set to an NSString which represents the resource's MIME type. You may also specify the "rel" property, which should be one of "enclosure", "related", "alternate", "via".

Reimplemented from <RSSMutableArticle>.

References notifyChange.

## articleFromStorageWithURL:

+ (id< RSSMutableArticle >) articleFromStorageWithURL: |  | (NSString*) | anURL |

Returns the article with the URL anURL from the storage

Provided by category RSSArticle(Storage).

## content

- (NSString *) content |  |  |

Returns
  The full text, an excerpt or a summary from the article

Reimplemented from <RSSArticle>.

References content.

Referenced by content, and url.

## date

- (NSDate *) date |  |  |

Returns the date of the publication of the article. If the source feed of this article didn't contain information about this date, the fetching date is usually returned.

Returns
  The date of the publication of the article

Reimplemented from <RSSArticle>.

## enclosure

- (NSURL *) enclosure |  |  |

Returns the Enclosure object of this article as URL. If there is no enclosure object, nil is returned.

Returns
  the URL of this article's enclosure object

Reimplemented from <RSSArticle>.

References notifyChange.

## headline

- (NSString *) headline |  |  |

Returns
  The headline of the article

Reimplemented from <RSSArticle>.

## init

- (id) init |  |  |

Standard initializer. You shouldn't use this. Better use initWithHeadline:url:description:date:

See also
  - initWithHeadline:url:description:date:

References init, and initWithHeadline:url:description:date:.

Referenced by init, and initWithHeadline:url:description:date:.

## initFromStorageWithURL:

- (id) initFromStorageWithURL: |  | (NSString*) | anURL |

Initialises the article with the URL anURL from the storage.

Initialises the article with the URL anURL from the storage.

Deprecated

Calling this method is generally a bad idea, since it doesn't allow you to decide on load-time which article is going to be created. Better use one of the RSSFactory methods for article unarchiving.

Provided by category RSSArticle(Storage).

## initWithDictionary:

- (id) initWithDictionary: |  | (NSDictionary*) | aDictionary |

Initialises the article instance with the contents of the aDictionary variable.

Provided by category RSSArticle(Storage).

Referenced by RSSArticle(Storage)::initFromStorageWithURL:.

## initWithHeadline:url:description:date:

- (id) initWithHeadline: |  | (NSString*) | myHeadline
url: |  | (NSString*) | myUrl
description: |  | (NSString*) | myDescription
date: |  | (NSDate*) | myDate

Designated initializer for the RSSArticle class.

Don't create RSSArticle objects yourself. Create a RSSFeed object and let it fetch the articles for you!

Parameters

  myHeadline | A NSString containing the headline of the article.
  myUrl | A NSString containing the URL of the full version of the article.
  myDescription | An excerpt of the article text or the full text.
  myDate | The date as NSDate object on which this article was posted.

See also
  RSSFeed

References init.

Referenced by init.

## isEqual:

- (BOOL) isEqual: |  | (id) | anObject |

RSS Articles are equal if both the article headlines and the article URLs are equal. If they are equal is tested by calling the isEqual: method on those.

## links

- (NSArray *) links |  |  |

Returns an NSArray containing NSURL objects or nil, if there are none. The contained NSURL objects often have the "type" and "rel" properties set. See the documentation for addLink: for details.

Returns
  The links of the article.

Reimplemented from <RSSArticle>.

## notifyChange

- (void) notifyChange |  |  |

Sends a change notification to the notification center. Useful for subclassing.

References notifyChange.

Referenced by addLink:, enclosure, notifyChange, and setLinks:.

## plistDictionary

- (NSMutableDictionary *) plistDictionary |  |  |

Returns the dictionary that stores the information for this article object.

Provided by category RSSArticle(Storage).

Referenced by RSSArticle(Storage)::store.

## setDate:

- (void) setDate: |  | (NSDate *) | aDate |

Sets the article's date.

Reimplemented from <RSSMutableArticle>.

## setLinks:

- (void) setLinks: |  | (NSArray *) | someLinks |

Replaces the list of links with a new one. See the documentation for addLink: for details. Hint: The parameter may also be nil.

Reimplemented from <RSSMutableArticle>.

References notifyChange.

## store

- (BOOL) store |  |  |

Stores the article (usually as a file in the Reader folder).

Reimplemented from <RSSArticle>.

Provided by category RSSArticle(Storage).

## url

- (NSString *) url |  |  |

Returns
  The URL of the full version of the article (as NSString*)

Reimplemented from <RSSArticle>.

References content.

## willBeReplacedByArticle:

- (void) willBeReplacedByArticle: |  | (id<RSSMutableArticle>) | newArticle |

This method is intended to make sure that the replacing article keeps some fields from the old (this) article. Subclasses will probably want to override this, but shouldn't forget calling the super implementation, first.

The documentation for this class was generated from the following files:

- RSSArticle.h
- RSSArticle.m