Skip to content

Instantly share code, notes, and snippets.

@sbentzen
Created August 31, 2011 19:48
Show Gist options
  • Save sbentzen/1184518 to your computer and use it in GitHub Desktop.
Save sbentzen/1184518 to your computer and use it in GitHub Desktop.
Grand Central Dispatch and NSXML Parser (the bad way)
NSURL *xmlURL = [NSURL URLWithString:URL];
rssParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
[rssParser setDelegate:self];
[rssParser setShouldProcessNamespaces:NO];
[rssParser setShouldReportNamespacePrefixes:NO];
[rssParser setShouldResolveExternalEntities:NO];
rssQueue = dispatch_queue_create("com.example.parser", NULL);
dispatch_async(rssQueue, ^{
[rssParser parse];
});
NSURL *xmlURL = [NSURL URLWithString:URL];
rssParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
[rssParser setDelegate:self];
[rssParser setShouldProcessNamespaces:NO];
[rssParser setShouldReportNamespacePrefixes:NO];
[rssParser setShouldResolveExternalEntities:NO];
rssQueue = dispatch_queue_create("com.example.parser", NULL);
dispatch_async(rssQueue, ^{
[rssParser parse];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment