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

  • Home
  • SEARCH
  • 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 179969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:30:07+00:00 2026-05-11T14:30:07+00:00

When I am scrolling my table way too down, application crushes. And I cannot

  • 0

When I am scrolling my table way too down, application crushes. And I cannot find where the error in code is.

Here is my code:

NSMutableDictionary *tableDataDictionary; NSInteger *rows_in_section;   -(void) initView {     if (!tableDataDictionary)     {         tableDataDictionary = [ [NSMutableDictionary alloc] init];     }     [self reloadTableData]; }  -(void)viewDidDisappear:(BOOL)animated {     [super viewDidDisappear:animated];     [mainTableView deselectRowAtIndexPath: [mainTableView indexPathForSelectedRow] animated:NO];      [tableDataDictionary release];     tableDataDictionary = nil;     free(rows_in_section); }  -(void) reloadTableData {     [tableDataDictionary removeAllObjects];       //Sections     if (rows_in_section)     {         free(rows_in_section);     }      rows_in_section = (NSInteger*)calloc(25, sizeof(NSInteger));     for (int i = 0; i <= 25; i++)     {         rows_in_section[i] = 0;     }      NSMutableArray *words_in_section = [ [NSMutableArray alloc] init];      int cur_section = -1;      while ( TRUE )     {         WordObject *tempWordObj = [ [WordsDatabase sharedWordsDatabase] getNextWordABC];         if (!tempWordObj)         {             [tableDataDictionary setObject:words_in_section forKey:[NSNumber numberWithInt: cur_section] ];             [tempWordObj release];              [tableDataDictionary setObject:[words_in_section copy] forKey:[NSNumber numberWithInt: cur_section] ];             [words_in_section removeAllObjects];              break;         }          //First loop         if (cur_section == -1) cur_section = toupper([ [tempWordObj word] characterAtIndex:0 ] ) - 'A';          //If a has letter changed, assign the previous array to a dictionary         if ( (toupper([ [tempWordObj word] characterAtIndex:0 ] ) - 'A') != cur_section )         {             [tableDataDictionary setObject:[words_in_section copy] forKey:[NSNumber numberWithInt: cur_section] ];             [words_in_section removeAllObjects];         }          cur_section = toupper([ [tempWordObj word] characterAtIndex:0 ] ) - 'A';          [words_in_section addObject:tempWordObj];          [tempWordObj release];         tempWordObj = nil;          rows_in_section[cur_section]++;      }      [words_in_section release];      [ [WordsDatabase sharedWordsDatabase] endGettingWordsABC];       [mainTableView reloadData];     [mainTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];  }   // // Table handling //  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {     return 26; }  // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {     return rows_in_section[section]; }  // Adding a section index here  - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView  {      return ALPHA_ARRAY;  }   - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {     return index; }   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {     DebugLog(@'cellForRowAtIndexPath');     static NSString *CellIdentifier = @'Cell';      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];     if (cell == nil) {         cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];     }       WordObject *tempWordObj = [ [tableDataDictionary objectForKey: [NSNumber numberWithInt:[indexPath section] ] ] objectAtIndex: [indexPath row] ];      if (!tempWordObj)     {         DebugLog(@'!tempWordObj');         return cell;     }      cell.text = [tempWordObj word];      [tempWordObj release];      return cell; } 

How can I solve this problem with scrolling down and why it occurs? And if you will find any other disadvantages in my code, please tell me this.

Thank you in advance, Ilya.

  • 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. 2026-05-11T14:30:08+00:00Added an answer on May 11, 2026 at 2:30 pm

    You do not need this line;

    [tempWordObj release]; 

    [NSDictionary objectForKey] returns an auto-released object, that is the object will be automatically released sometime after your function returns.

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

Sidebar

Ask A Question

Stats

  • Questions 100k
  • Answers 100k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is a good starting point, but it won't work… May 11, 2026 at 7:58 pm
  • Editorial Team
    Editorial Team added an answer That's not the way DataGridView works, and having tried before… May 11, 2026 at 7:58 pm
  • Editorial Team
    Editorial Team added an answer Yes, it is possible - I run a drupal site… May 11, 2026 at 7:58 pm

Related Questions

I can not control the scrolling of a scrollpane from within my actionscript (I
Here is my current situation: I have a web page containing a couple scrollable
I need to implement a grid in asp.net that behaves almost exactly like MS
I have two divs like so <div id=parent style=width:100px:overflow:hidden;> <div id=child> tooooooooooooooooooooo much content

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.