开发者

Not showing rss feed in xcode 4 iPhone app?

Am I doing something wrong? I think it might be the simulator but I'm not sure. I made a rss reader in my tabbar app. When i use the rss feed, It says 开发者_如何学Ccan't get rss feed in the UIAlertView I made when it can't get the feed. Is it the feed type? I'm not sure. Here is the code:

-(BOOL)fetchAndParseRss{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

    //To suppress the leak in NSXMLParser
    [[NSURLCache sharedURLCache] setMemoryCapacity:0];
    [[NSURLCache sharedURLCache] setDiskCapacity:0];

    NSURL *url = [NSURL URLWithString:@"feed:https://www.google.com/calendar/feeds/fcfihq@aol.com/public/basic?orderby=starttime"];
    BOOL success = NO;
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
    [parser setDelegate:self];
    [parser setShouldProcessNamespaces:YES];
    [parser setShouldReportNamespacePrefixes:YES];
    [parser setShouldResolveExternalEntities:NO];
    success = [parser parse];
    [parser release];
    [pool drain];
    return success;
}

There is also a warning: "class 'BlogRssParser' does not implement the 'NSXMLParserDelegate' protocol"


try removing the "feed:"

NSURL *url = [NSURL URLWithString:@"https://www.google.com/calendar/feeds/fcfihq@aol.com/public/basic?orderby=starttime"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜