syntax highlight in readme
This commit is contained in:
@@ -30,7 +30,7 @@ In the previous version, the test case for parsing a non-opml file (with `RSOPML
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```objc
|
||||||
RSXMLData *xmlData = [[RSXMLData alloc] initWithData:d urlString:@"https://www.example.org"];
|
RSXMLData *xmlData = [[RSXMLData alloc] initWithData:d urlString:@"https://www.example.org"];
|
||||||
// TODO: check xmlData.parserError
|
// TODO: check xmlData.parserError
|
||||||
RSFeedParser *parser = [RSFeedParser parserWithXMLData:xmlData];
|
RSFeedParser *parser = [RSFeedParser parserWithXMLData:xmlData];
|
||||||
@@ -44,7 +44,7 @@ RSParsedFeed *document = [parser parseSync:&parseError];
|
|||||||
|
|
||||||
If you don't care about the parser used to decode the data, `[xmlData getParser]` will return the most suitable parser. You can use that parser right away to call `parseSync:`. Anyway, you can also parse the XML file asynchronously with `parseAsync:`.
|
If you don't care about the parser used to decode the data, `[xmlData getParser]` will return the most suitable parser. You can use that parser right away to call `parseSync:`. Anyway, you can also parse the XML file asynchronously with `parseAsync:`.
|
||||||
|
|
||||||
```
|
```objc
|
||||||
[[xmlData getParser] parseAsync:^(RSParsedFeed *parsedDocument, NSError *error) {
|
[[xmlData getParser] parseAsync:^(RSParsedFeed *parsedDocument, NSError *error) {
|
||||||
// process feed items ...
|
// process feed items ...
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user