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 とは何ですか? MSではなくNSから始めるべきだと思います。

MSDataDictionary を検索しましたが、何も得られませんでした。

于 2012-07-02T05:43:18.733 に答える