The iOS framework that grows only as fast as its documentation
NICSSParser Class Reference


An Objective-C wrapper for the flex CSS parser.

Generates a dictionary of raw CSS rules from a given CSS file.

It is recommended that you do NOT use this object directly. Use NIStylesheet instead.

Terminology note: CSS selectors are referred to as "scopes" to avoid confusion with Objective-C selectors.

This object is not thread-safe.


BOOL didFailToParse property
(NSDictionary *) - dictionaryForPath:pathPrefix:delegate:
(NSDictionary *) - dictionaryForPath:pathPrefix:
(NSDictionary *) - dictionaryForPath:

Method Documentation


Will be YES after retrieving a dictionary if the parser failed to parse the file in any way.

@property (nonatomic, readonly) BOOL didFailToParse;


Reads a CSS file from a given path and returns a dictionary of raw CSS rule sets.

- (NSDictionary*)dictionaryForPath:(NSString *)path pathPrefix:(NSString *)pathPrefix delegate:(id<NICSSParserDelegate>)delegate;

If a pathPrefix is provided then all paths will be prefixed with this value.

For example, if a path prefix of "/bundle/css" is given and a CSS file has the statement "@import url('user/profile.css')", the loaded file will be "/bundle/css/user/profile.css".

pathThe path of the file to be read.
pathPrefix[optional] A prefix path that will be prepended to the given path as well as any imported files.
delegate[optional] A delegate that can reprocess paths.
A dictionary mapping CSS scopes to dictionaries of property names to values.