Class: NKLibrary

Inherits:
NSObject show all

Overview

An instance of the NKLibrary class represents the library of issues for a newsstand content application.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (NKIssue) currentlyReadingIssue

Accesses or sets the newsstand issue that the user is currently reading. When you ascertain what issue the user is currently reading, you should set this property to the corresponding NKIssue instance. Newsstand Kit takes this setting into consideration when it purges back issues because of low levels of available flash storage.

Returns:

- (Array) downloadingAssets (readonly)

The assets that are currently being downloaded for one or more issues of the newsstand content library. (read-only) When a newsstand application launches, it should enumerate the NKAssetDownload objects in the returned array, call downloadWithDelegate: on each object, and process each downloaded asset.

Returns:

- (Array) issues (readonly)

Returns the current issues of the newsstand content library. (read-only) Each item in the returned array is an instance of NKIssue. If there are no issues, an empty array is returned.

Returns:

Class Method Details

+ (NKLibrary) sharedLibrary

Returns the shared instance representing the newsstand content library.

Returns:

  • (NKLibrary)

    A singleton instance of the NKLibrary class or nil if the instance couldn’t be created.

Instance Method Details

- (NKIssue) addIssueWithName(name, date:date)

Creates a newsstand issue and adds it to the content library. The created issue is automatically added to the newsstand content library. Issues are ordered by their release date. The release date of an issue can be a factor when Newsstand Kit must delete back issues because of low levels of available flash storage.This method throws an exception if the name and date parameters are nil or are otherwise not valid objects. It also throws an exception if you pass in an issue name that is used by another issue.

Parameters:

  • name (String)

    The name of the newsstand issue. This parameter is required and the name must be unique across all issues in the library.

  • date (NSDate)

    The date the newsstand issue was released. This parameter is required.

Returns:

  • (NKIssue)

    An instance of the NKIssue class or nil if the instance couldn’t be created.

- (NKIssue) issueWithName(name)

Returns an issue of the newsstand content library specified by name.

Parameters:

  • name (String)

    The name of an issue.

Returns:

  • (NKIssue)

    An instance of NKIssue representing the issue or nil if the issue couldn’t be retrieved—for example, if an issue of that name doesn’t exist in the library.

- (Object) removeIssue(issue)

Removes the specified issue from the newsstand content library. When an issue is removed, any data at the file-system location identified by the issue’s content URL (accessed through the contentURL property of NKIssue) is deleted from disk. If you have issue content elsewhere in the application sandbox, it’s your responsibility to clean it up. Calling this method also cancels any asset downloads for that issue that are underway.

Parameters:

  • issue (NKIssue)

    An instance of NKIssue representing an issue in the newsstand content library.

Returns: