NKIssue Class Reference

Inherits from
Conforms to
Framework
/System/LIbrary/Frameworks/NewsstandKit.framework
Availability
Available in iOS 5.0 and later.
Declared in
NKIssue.h

Overview

An instance of the NKIssue class represents an issue of a newsstand content application.

An NKIssue object must have a name and a date. When you create the object using the addIssueWithName:date: method of the NKLibrary class, you must supply these two values. In addition, an NKIssue object can be associated with one or more assets that are downloading. These assets are represented by NKAssetDownload objects, which you create and associate with the issue by calling the addAssetWithRequest: method. If there are downloading assets, the NKIssue object has a status of NKIssueContentStatusDownloading.

As assets are being downloaded for an issue, you should put the processed (for example, unarchived or assembled) issue assets in the sandbox file-system location identified by contentURL. After all downloads of assets for an issue have completed, NKIssue posts the NKIssueDownloadCompletedNotification notification which objects in an application can observe.

Tasks

Managing Issue Assets

Accessing the Location of Issue Content

Accessing Attributes of an Issue

Properties

contentURL

The location in the application sandbox where issue content should be stored. (read-only)

@property(nonatomic, readonly) NSURL *contentURL
Discussion

The application, after processing downloaded assets, should write the issue content to the filesystem location identified by this property.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

date

The date of the newsstand issue. (read-only)

@property(nonatomic, readonly) NSDate *date
Discussion

This date is provided when the NKIssue instance is created through the addIssueWithName:date: method of NKLibrary.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

downloadingAssets

Returns the assets that are currently downloading for the newsstand issue. (read-only)

@property(nonatomic, readonly) NSArray *downloadingAssets
Discussion

Each item in the returned array is an instance of NKAssetDownload. If there are any downloading assets for the issue, the representing NKIssue object has a status of NKIssueContentStatusDownloading.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

name

The name of the newsstand issue. (read-only)

@property(nonatomic, readonly) NSString *name
Discussion

This name is provided when the NKIssue instance is created through the addIssueWithName:date: method of NKLibrary. The name must be unique across all issues in the library.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

status

The status of the newsstand issue. (read-only)

@property(nonatomic, readonly) NKIssueContentStatus status
Discussion

An issue’s status is either available, downloading, or none. Each of these reflect whether assets are downloading for the issue and if there is issue content at contentURL. See the description of the NKIssueContentStatus type for more information.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

Instance Methods

addAssetWithRequest:

Adds an asset to the list of assets to be downloaded and returns an instance representing that asset.

- (NKAssetDownload *)addAssetWithRequest:(NSURLRequest *)request
Parameters
request

An object representing a URL request.

Return Value

An instance of NKAssetDownload, which represents an issue asset that can be downloaded from the application’s server. Returns nil if there a problem creating the object.

Discussion

You must send downloadWithDelegate: to the returned object to begin the downloading of the asset.

Availability
  • Available in iOS 5.0 and later.
Declared In
NKIssue.h

Constants

NKIssueContentStatus

The status of the newsstand issue.

typedef enum {
   NKIssueContentStatusNone,
   NKIssueContentStatusDownloading,
   NKIssueContentStatusAvailable,
} NKIssueContentStatus;
Constants
NKIssueContentStatusNone

Assets are not downloading for the issue and there is no content at contentURL.

Available in iOS 5.0 and later.

Declared in NKIssue.h.

NKIssueContentStatusDownloading

The issue has assets that are currently downloading.

Available in iOS 5.0 and later.

Declared in NKIssue.h.

NKIssueContentStatusAvailable

Downloading of assets is not taking place and there is issue content at contentURL.

Available in iOS 5.0 and later.

Declared in NKIssue.h.

Declared In
NKIssue.h

Notifications

NKIssueDownloadCompletedNotification

Posted when all assets of the issue have been downloaded.

The NKIssue object is the posting object. There is no userInfo dictionary.

Availability
Declared In
NKIssue.h