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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:11:46+00:00 2026-06-04T17:11:46+00:00

I have a table view that loads information from the web, and displays it

  • 0

I have a table view that loads information from the web, and displays it in custom cells. In these custom cells I have a button that I assigned through storyboard.

If this button is pressed, it triggers a method (defined in the cellForRowAtIndexPath method)

cell.viewArticleButton.action = @selector(viewArticle:); 

It is in this method that I am having trouble. The action works except that it doesn’t use the link provided for each respective cell (the link at each index path) instead it uses only the first row’s link, regardless of what row I tap.

-(IBAction)viewArticle:(id)sender {

NSLog(@"View Article Button Tapped");

NewsCell *cell = (NewsCell *)[self.tableView dequeueReusableCellWithIdentifier:@"NewsCell"];

NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; 

MWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row];

   // Open link from item.link

}

Any help would be appreciated. I have a feeling that it is this line that isn’t doing what I want:

NewsCell *cell = (NewsCell *)[self.tableView dequeueReusableCellWithIdentifier:@"NewsCell"];
  • 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-04T17:11:47+00:00Added an answer on June 4, 2026 at 5:11 pm

    Why not add add in the NSIndexPath into the method:

    cell.viewArticleButton.action = @selector(viewArticle:indexPath);
    
    -(IBAction)viewArticle:(id)sender {
    NSIndexPath *indexPath = (NSIndexPath *)sender;
    
    NSLog(@"View Article Button Tapped for section %d, row $d", indexPath.section, indexPath.row);
    
    // I have no idea why you are doing this...
    NewsCell *cell = (NewsCell *)[self.tableView dequeueReusableCellWithIdentifier:@"NewsCell"];
    
    
    MWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row];
    
       // Open link from item.link
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large table that get populated from a view. This is done
I have a button which when pressed makes calls that load information from a
I have a tab view that loads a table view for each of the
I have a program where a UITableView contains custom cells loaded from nibs. These
I have a table view that I am customizing and I am adding a
I have a table view that is managed by an NSFetchedResultsController. I am having
I have one table view that should be filtered by values of search field
I have a first table view and a segue that pushes to another table
I have an app that presents Table View of different files. I have it
I have an MVC application view that is generating quite a large HTML table

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.