Click here to support Nimbus development and make a donation at www.pledgie.com !
An iOS framework whose growth is bounded by O(documentation).
NIChameleonObserver Class Reference

Overview

An observer for the Chameleon server.

This observer connects to a Chameleon server and waits for changes in stylesheets. Once a stylesheet change has been detected, the new stylesheet is retrieved from the server and a notification is fired via NIStylesheetDidChangeNotification after the stylesheet has been reloaded.

Thanks to the use of NIOperations, the stylesheet loading and processing is accomplished on a separate thread. This means that the UI will only be notified of stylesheet changes once the request thread has successfully loaded and processed the changed stylesheet.

Definition at line 39 of file NIChameleonObserver.h.

Inheritance diagram for NIChameleonObserver:
<NIOperationDelegate> <NICSSParserDelegate>

Methods

(id) - initWithStylesheetCache:host:
(NIStylesheet *) - stylesheetForPath:
(void) - watchSkinChanges
(NSString *) - cssParser:pathFromPath:
[NIOperationDelegate] State Changes
(void) - nimbusOperationDidStart:
(void) - nimbusOperationWillFinish:
(void) - nimbusOperationDidFinish:
(void) - nimbusOperationDidFail:withError:

Method Documentation

- (id) initWithStylesheetCache: (NIStylesheetCache *)  stylesheetCache
host: (NSString *)  host 

Initializes a newly allocated Chameleon observer with a given stylesheet cache and host.

Definition at line 50 of file NIChameleonObserver.m.

- (NIStylesheet *) stylesheetForPath: (NSString *)  path

Returns a loaded stylesheet from the given path.

Definition at line 193 of file NIChameleonObserver.m.

- (void) watchSkinChanges

Begins listening to the Chameleon server for changes.

When changes are detected the Chameleon observer downloads the new CSS files, reloads them, and then fires the appropriate notifications.

Definition at line 199 of file NIChameleonObserver.m.

- (void) nimbusOperationDidStart: (NIOperation *)  operation

The operation has started executing.

- (void) nimbusOperationWillFinish: (NIOperation *)  operation

The operation is about to complete successfully.

This will not be called if the operation fails.

This will be called from within the operation's runloop and must be thread safe.

- (void) nimbusOperationDidFinish: (NIOperation *)  operation

The operation has completed successfully.

This will not be called if the operation fails.

- (void) nimbusOperationDidFail: (NIOperation *)  operation
withError: (NSError *)  error 

The operation failed in some way and has completed.

operationDidFinish: will not be called.

- (NSString *) cssParser: (NICSSParser *)  parser
pathFromPath: (NSString *)  path 
[required, inherited]

The implementor may use this method to change the filename that will be used to load the CSS file from disk.

If nil is returned then the given filename will be used.

Example: This is used by the Chameleon observer to hash filenames with md5, effectively flattening the path structure so that the files can be accessed without creating subdirectories.

Generated for Nimbus by doxygen 1.7.4-20110629