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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:24:29+00:00 2026-06-14T00:24:29+00:00

Today I encountered bug, that I’m unable to replicate and it is very confusing

  • 0

Today I encountered bug, that I’m unable to replicate and it is very confusing for me.
Ok little background:

I’m currently working on app, that has tab bar controller as initial view controller. There are several nav controllers connected to different tab bar items.

One of them is a tableViewController, that is populated from JSON.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

static NSString *simpleTableIdentifier = @"SimpleTableItem";
   SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];

if (cell == nil)
{
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
    cell = [nib objectAtIndex:0];
}   

     //NSMutableArray for storing loaded values
[pics addObject:imageLoad];
[names addObject:[aucdict objectForKey:@"name"]];
[idcka addObject:[aucdict objectForKey:@"auction_id"]];

  // Configure the cell...
cell.nameLabel.text = [aucdict objectForKey:@"name"];
cell.priceLabel.text = [NSString stringWithFormat:@"%@",priceString];
cell.timeLabel.text = [NSString stringWithFormat:@"%@",timeString];

cell.thumbnailImageView.image = imageLoad;



return cell;}

After clicking on row, I perform performSegueWithIdentifier:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[self performSegueWithIdentifier:@"showAuctionDetail" sender:self];}

and in prepareForSegue I send some data to next ViewController

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 

{

namesArray = [[NSArray alloc] initWithArray:names];
picsArray =[[NSArray alloc] initWithArray:pics];
IDarray = [[NSArray alloc] initWithArray:idcka];
if ([segue.identifier isEqualToString:@"showAuctionDetail"])
{
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    detailViewController *dViewController = segue.destinationViewController;
    dViewController.selectedAuctionTitle = [namesArray objectAtIndex:indexPath.row];
    dViewController.auctionPic = [picsArray objectAtIndex:indexPath.row];
    dViewController.id_aukcie = [IDarray objectAtIndex:indexPath.row];
}}

Now comes my problem. Sometimes (this really confuses me, because it I haven’t found when does it happen) when I start the application, and tap on some row, I get totally different data passed to DetailViewController. The only thing, I can guess is that my arrays are different (they contain more or less values) than actual JSON response. But that would mean, my app would crash if I clicked on first or last item in table (index out of bounds or something like that), that never happened.

I’ve seen this bug happened maybe 5 times randomly. I tried to run and quit app for 20 times in a row and it happened only once.

P.S. I know that class name (detailViewController) should start with capital letter, I apologize for that 🙂

edited: as rdelmar suggested

  • 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-14T00:24:30+00:00Added an answer on June 14, 2026 at 12:24 am

    I think the problem is having the call out to the server in the cellForRowAtIndexPath: method. You should put that code in viewDidLoad, and then when the data has come back, and is finished parsing, call reloadData on your table view.

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

Sidebar

Related Questions

I encountered today a weird bug with an app I'm working on. The problem
I have encountered a very strange thing today : I have an app installed
Today I've encountered a very good book : UNIX to Linux® Porting: A Comprehensive
I decided to modify some code today, and encountered an error that doesn't make
I encountered an interesting thing today that I have never noticed before. It appears
Today I encountered a terrible problem. I've been working on a whole framework with
Something I encountered today at work, I tried to make a view that used
I was doing some testing and debugging of my Iphone app today and encountered
I was very surprised to get this error today, as it's one that I've
I was very surprised to get this error today, as it's one that I've

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.