Проверьте эту ссылку, это решило мою проблему
https://github.com/mwaterfall/MWFeedParser
Здесь приведены шаги для добавления кода
Add all the classes,except detailtableviewcontroller and Rootviewcontroller from the code you downloaded from the link. Then add #import "MWFeedParser.h" in your.h file where you are parsing .Then add // Parsing
MWFeedParser *feedParser;
NSMutableArray *parsedItems;
// Displaying
NSArray *itemsToDisplay;
NSDateFormatter *formatter;and /***mwfeed (*/
@property (nonatomic, retain) NSArray *itemsToDisplay;
/*------------*/
Then in .m add the codeformatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterShortStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
parsedItems = [[NSMutableArray alloc] init];
self.itemsToDisplay = [NSArray array];
// Parse
NSURL *feedURL = [NSURL URLWithString:@"http://feeds.feedburner.com/yummydietfood?format=xml"];
feedParser = [[MWFeedParser alloc] initWithFeedURL:feedURL];
feedParser.delegate = self;
feedParser.feedParseType = ParseTypeFull; // Parse feed info and all items
feedParser.connectionType = ConnectionTypeAsynchronously;
[feedParser parse];
#pragma mark -
#pragma mark MWFeedParserDelegate
- (void)feedParserDidStart:(MWFeedParser *)parser {
//[UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
NSLog(@"Started Parsing: %@", parser.url);
}
- (void)feedParser:(MWFeedParser *)parser didParseFeedInfo:(MWFeedInfo *)info {
NSLog(@"Parsed Feed Info: “%@”", info.title);
//self.title = info.title;
}
- (void)feedParser:(MWFeedParser *)parser didParseFeedItem:(MWFeedItem *)item {
NSLog(@"Parsed Feed Item: “%@”", item.title);
if (item) [parsedItems addObject:item];
}
- (void)feedParserDidFinish:(MWFeedParser *)parser {
NSLog(@"Finished Parsing%@", (parser.stopped ? @" (Stopped)" : @""));
self.itemsToDisplay = [parsedItems sortedArrayUsingDescriptors:
[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:@"date"
ascending:NO] autorelease]]];
[UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
//[self performSelector:@selector(loadData)];
[self performSelector:@selector(loadDataWithOperation)];
}
- (void)feedParser:(MWFeedParser *)parser didFailWithError:(NSError *)error {
NSLog(@"Finished Parsing With Error: %@", error);
UIAlertView *erroralert = [[UIAlertView alloc]initWithTitle:@"Error!" message:@"Problem connecting server, try again in few minutes" delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil];
[erroralert show];
[erroralert release];
self.itemsToDisplay = [NSArray array];
[parsedItems removeAllObjects];
self.tbl.userInteractionEnabled = YES;
[self.tbl reloadData];
}
и где вам нужны данные, проанализированные парсером, которые называются этой строкой кода
if (item) {
NSString *itemTitle = item.title ? [item.title stringByConvertingHTMLToPlainText] : @"[No Title]";
lbl.text = itemTitle;
}
else {
lbl.text=@"No Title";
}