Created
January 6, 2011 15:48
-
-
Save pjaspers/768044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)liveRequest:(ASIHTTPRequest *)request didReceiveData:(NSData *)data { | |
NSString *aString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; | |
NSError *error = nil; | |
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(\\{.*?\\})"options:NSRegularExpressionCaseInsensitive error:&error]; | |
[regex enumerateMatchesInString:aString options:0 range:NSMakeRange(0, [aString length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop){ | |
//DLog(@"Our Range %@", NSStringFromRange(match.range)); | |
//DLog(@"Text %@", [aString substringWithRange:match.range]); | |
[Parser parserWithResponse:[aString substringWithRange:match.range] delegate:self andRequest:request]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment