1

如何使用Objective c中的属性从xml动态传递URL,然后我想将url存储在匹配字符串中。

NSString * home= @"http://sports.xyz.rss/rss.aspx";
    MSXMLParser * homenew=[[MSXMLParser alloc]init];
    [homenew parseWithURLString:home FileName:@"file" xmlType:@"MATCHES"];
    NSMutableDictionary * mainDict = [MSDataDictionary newsDictionary];
    for (int i=0; i<=[mainDict count]; i++) 
    {
        NSString * theKey = [NSString stringWithFormat:@"%d",i];
        NSMutableDictionary * itemDict = [mainDict objectForKey:theKey];

        matches = [itemDict objectForKey:@"title"];
        if ([matches isEqualToString:@"cric"])
        {
            matches=[itemDict objectForKey:@"link"];
            break;
        }

    }

    NSString * home=matches;
4

1 回答 1

0

什么是 MSDataDictionary?我认为它应该从 NS 而不是 MS 开始。

我搜索了 MSDataDictionary 但没有得到任何东西。

于 2012-07-02T05:43:18.733 回答