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 6140511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:07:38+00:00 2026-05-23T18:07:38+00:00

I am playing around with this tutorial I found on a website. It is

  • 0

I am playing around with this tutorial I found on a website. It is an RSS Feed application. Here’s the link: RSS Tutorial

I have got the RSS Feed working in my application. I got curious and instead of having a normal refresh button, I opted for a pull down refresh. PullDownRefresh Tutorial

I implemented into the RSS feed. All looks good and working but just not refreshing. So I tried adding some code in in order to make it refresh when I pull the tableview down.

The code I put is:

- (void)reloadTableViewDataSource {

//should be calling your tableviews data source model to reload.
//put here just for demo.
[self performSelector:@selector(refresh)];
_reloading = YES;
[self.tableView reloadData];
}

But this duplicates the feeds.

I tried to clear my datasource prior to this with self.tableView.dataSource = nil; but adding this crashes it here:

`- (void)requestFinished:(ASIHTTPRequest *)request {

[_queue addOperationWithBlock:^{

    NSError *error;
    GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:[request responseData] 
                                                           options:0 error:&error];

    if (doc == nil) { 
        NSLog(@"Failed to parse %@", request.url);
    } else {

        NSMutableArray *entries = [NSMutableArray array];
        [self parseFeed:doc.rootElement entries:entries];                
     NSSortDescriptor *itemSort = [[NSSortDescriptor alloc] initWithKey:@"articleDate" ascending:YES];
     NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:itemSort,nil];
     [entries sortUsingDescriptors:sortDescriptors];

        [[NSOperationQueue mainQueue] addOperationWithBlock:^{

            for (RSSEntry *entry in entries) {

                int insertIdx = [_allEntries indexForInsertingObject:entry sortedUsingBlock:^(id a, id b) {
                    RSSEntry *entry1 = (RSSEntry *) a;
                    RSSEntry *entry2 = (RSSEntry *) b;
                    return [entry1.articleDate compare:entry2.articleDate];
                }];

                [_allEntries insertObject:entry atIndex:insertIdx];

                [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:insertIdx inSection:0]] //Thread 1: Program received signal: "SIGABRT".
                                      withRowAnimation:UITableViewRowAnimationRight];
            }                            
        }];
    }        
}];
}`

The output window says this:

Terminating app due to uncaught exception
‘NSInternalInconsistencyException’, reason: ‘Invalid update: invalid
number of rows in section 0. The number of rows contained in an
existing section after the update (0) must be equal to the number of
rows contained in that section before the update (0), plus or minus
the number of rows inserted or deleted from that section (1 inserted,
0 deleted).’

Any ideas?

  • 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-05-23T18:07:39+00:00Added an answer on May 23, 2026 at 6:07 pm
    - (void)viewDidLoad
    {
    [super viewDidLoad];
    
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    self.allEntries = [NSMutableArray array];    
    self.title= NSLocalizedString(@"News feeds", @"Storage");   
    self.queue = [[[NSOperationQueue alloc] init ] autorelease];
    self.feeds = [NSArray arrayWithObjects:
                  @"feed://www.yourfeed.com/feed.xml",
                  nil];    
    
    [self.tableView reloadData];
    
    // Add the right reload button
    UIBarButtonItem *reloadButton = [[UIBarButtonItem alloc] 
                           initWithTitle:NSLocalizedString(@"Refresh")                                            
                           style:UIBarButtonItemStyleBordered 
                           target:self 
                           action:@selector(viewDidLoad)];
    self.navigationItem.rightBarButtonItem = reloadButton;
    self.navigationItem.rightBarButtonItem.style = UIBarButtonItemStyleDone;
    [reloadButton release];
    
    [self refresh];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been playing around with this for a couple of hours and have come
I have recently started playing around with iOS development and have got most of
I am playing around with HTML 5 apps according to this tutorial: http://sixrevisions.com/web-development/html5-iphone-app/ It's
Update: After playing around with this for a few hours, went with a multi-query
While playing around with regexps in Scala I wrote something like this: scala> val
After playing around with haskell a bit I stumbled over this function: Prelude Data.Maclaurin>
I was playing around with recursion and did this simple function. I was assuming
I'm playing around with gmock and noticed it contains this line: #include <tuple> I
I'm playing around with list comprehensions and I came across this little snippet on
I was playing around with Boost.Regex to parse strings for words and numbers. This

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.