Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:38:35+00:00 2026-06-17T14:38:35+00:00

I’m trying to map the items of the RSS feeds. The RKObjectRequestOperation returns the

  • 0

I’m trying to map the items of the RSS feeds. The RKObjectRequestOperation returns the exact number of objects but the attributes values are nil. Following is my code

 NSURL *requestURL = [NSURL URLWithString:@"http://sports.espn.go.com/espn/rss/nfl/news"];
 [RKMIMETypeSerialization registerClass:[RKXMLReaderSerialization class] forMIMEType:@"application/rss+xml"];
RKObjectMapping *rssFeedObjectMapping = [RKObjectMapping mappingForClass:[SBRssFeed class]];
    [rssFeedObjectMapping addAttributeMappingsFromDictionary:@{
     @"title" : @"title",
     @"link" : @"link"
}];

RKResponseDescriptor *rssFeedResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:rssFeedObjectMapping
                                                                                              pathPattern:nil
                                                                                                  keyPath:@"rss.channel.item"
                                                                                              statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];

 RKObjectRequestOperation *requestOperation = [[RKObjectRequestOperation alloc]initWithRequest:[NSURLRequest requestWithURL:requestURL]
                                                                              responseDescriptors:@[rssFeedResponseDescriptor]];
    [requestOperation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
        _datasourceArray = mappingResult.array;
        NSLog(@"Count %d", _datasourceArray.count);
        [self.tableView reloadData];
    }
                                            failure:^(RKObjectRequestOperation *operation, NSError *error) {
                                                NSLog(@"Error %@", error);
                                            }];
    [requestOperation start];

Is there something that I missed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:38:37+00:00Added an answer on June 17, 2026 at 2:38 pm

    I figured out the problem. The problem was regarding to the XMLReader class associated with RKXMLReaderSerialization. The RKObjectMapping class failed to map the dictionary’s keys with object’s properties. The reason was the output dictionary on XMLReader.

    {
        rss =     {
            channel =         {
                "atom:link" =             {
                    href = "http://www.nytimes.com/services/xml/rss/nyt/Baseball.xml";
                    rel = self;
                    type = "application/rss+xml";
                };
                copyright =             {
                    text = "Copyright 2013 The New York Times Company";
                };
                description =             {
                    text = Baseball;
                };
                image =             {
                    link =                 {
                        text = "http://www.nytimes.com/pages/sports/baseball/index.html?partner=rss&emc=rss";
                    };
                    title =                 {
                        text = "NYT > Baseball";
                    };
                    url =                 {
                        text = "http://graphics8.nytimes.com/images/misc/NYT_logo_rss_250x40.png";
                    };
                };
                item =             (
                                    {
                                        "atom:link" =                     {
                                            href = "http://www.nytimes.com/2013/01/23/sports/baseball/rays-add-right-hander-with-a-new-name.html?partner=rss&emc=rss";
                                            rel = standout;
                                        };
                                        category =                     (
                                                                        {
                                                                            domain = "http://www.nytimes.com/namespaces/keywords/nyt_org_all";
                                                                            text = "Tampa Bay Rays";
                                                                        },
                                                                        {
                                                                            domain = "http://www.nytimes.com/namespaces/keywords/des";
                                                                            text = Baseball;
                                                                        }
                                                                        );
                                        "dc:creator" =                     {
                                            text = "By THE ASSOCIATED PRESS";
                                        };
                                        description =                     {
                                            text = "The Rays agreed on a minor league contract with the right-hander Juan Carlos Oviedo, who played under the fake name Leo Nunez before an eight-week suspension by Major League Baseball last year.<img width='1' height='1' src='http://rss.nytimes.com/c/34625/f/640313/s/27cc926a/mf.gif' border='0'/><br/><br/><a href=\"http://da.feedsportal.com/r/151884969355/u/82/f/640313/c/34625/s/27cc926a/a2.htm\"><img src=\"http://da.feedsportal.com/r/151884969355/u/82/f/640313/c/34625/s/27cc926a/a2.img\" border=\"0\"/></a><img width=\"1\" height=\"1\" src=\"http://pi.feedsportal.com/r/151884969355/u/82/f/640313/c/34625/s/27cc926a/a2t.img\" border=\"0\"/>";
                                        };
                                        guid =                     {
                                            isPermaLink = false;
                                            text = "http://www.nytimes.com/2013/01/23/sports/baseball/rays-add-right-hander-with-a-new-name.html";
                                        };
                                        link =                     {
                                            text = "http://www.nytimes.com/2013/01/23/sports/baseball/rays-add-right-hander-with-a-new-name.html?partner=rss&emc=rss";
                                        };
                                        pubDate =                     {
                                            text = "Wed, 23 Jan 2013 04:01:23 GMT";
                                        };
                                        title =                     {
                                            text = "Rays Add Right-Hander With a New Name";
                                        };
                                    });
                language =             {
                    text = "en-us";
                };
                lastBuildDate =             {
                    text = "Wed, 23 Jan 2013 04:20:27 GMT";
                };
                link =             {
                    text = "http://www.nytimes.com/pages/sports/baseball/index.html?partner=rss&emc=rss";
                };
                pubDate =             {
                    text = "Wed, 23 Jan 2013 04:20:27 GMT";
                };
                title =             {
                    text = "NYT > Baseball";
                };
                ttl =             {
                    text = 2;
                };
            };
            version = "2.0";
            "xmlns:atom" = "http://www.w3.org/2005/Atom";
            "xmlns:dc" = "http://purl.org/dc/elements/1.1/";
            "xmlns:itunes" = "http://www.itunes.com/dtds/podcast-1.0.dtd";
            "xmlns:media" = "http://search.yahoo.com/mrss/";
            "xmlns:rdf" = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
            "xmlns:taxo" = "http://purl.org/rss/1.0/modules/taxonomy/";
        };
    }
    

    As in the above response, each tag is associated with a dictionary, which in turn has ‘text’ as a key.

    So I changed the object mapping to

        RKObjectMapping *rssFeedObjectMapping = [RKObjectMapping mappingForClass:[SBRssFeed class]];
        [rssFeedObjectMapping addAttributeMappingsFromDictionary:@{
         @"title.text" : @"title",
         @"link.text" : @"link"
    }];
    

    This solved my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.