ここに、Webサービス経由で受信したxmlがあります..
<?xml version="1.0" encoding="utf-8"?>
<Quotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://swanandmokashi.com">
<QuoteOfTheDay>Hit any user to continue.</QuoteOfTheDay>
<Author>Fuzzel Fish Administration Page</Author>
</Quotes>
そして、私のconnectionDidFinishLoadingでこれを解析しようとしています: ...
{
webData_str=[[NSString alloc]initWithData:webData encoding:NSUTF8StringEncoding];
NSString *pattern = @"<QuoteOfTheDay>(.*)</QuoteOfTheDay><Author>(.*)</Author>";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive error:nil];
__block NSString *QuoteString,*author= nil;
[regex enumerateMatchesInString:webData_str options:0 range:NSMakeRange(0, [webData_str length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop) {
// not executing...
if (0 < [match numberOfRanges]) {
NSRange range = [match rangeAtIndex:1];
QuoteString = [webData_str substringWithRange:range];
NSRange range1 = [match rangeAtIndex:2];
author = [webData_str substringWithRange:range1];
}
}];
final=[NSString stringWithFormat:@"\n%@\n%@",QuoteString,author];
NSLog(@"Final--- %@",final);
}
これで何が問題なのですか?、実行フローがブロック内に入らない..