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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:52:04+00:00 2026-05-20T10:52:04+00:00

This is driving me crazy! I keep crashing with this error. Below is my

  • 0

This is driving me crazy! I keep crashing with this error. Below is my code. I am trying to put an extra cell in my UITabelView for a “25 more” feature. But I crash below inside of the heightForRowAtIndexPath function. What am I overlooking?

TIA.

[NSMutableArray objectAtIndex:]: index
4294967295 beyond bounds [0 .. 8]’

0 CoreFoundation
0x01338be9 __exceptionPreprocess + 185
1 libobjc.A.dylib
0x0148d5c2 objc_exception_throw + 47
2 CoreFoundation
0x0132e6e5 -[__NSArrayM
objectAtIndex:] + 261 3
mackdabMobile
0x00004f56
-[AllmackTableViewController tableView:heightForRowAtIndexPath:] +

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
    {
        NSLog(@"IndexRow int: %i", indexPath.row);
        NSLog(@"postsArray count: %i", [postsArray count]);
        if(indexPath.row < [postsArray count]){  **<----Where it crashes**
            Post *myPost = [postsArray objectAtIndex:[indexPath row] - 1];
            NSString *text = myPost.description;

            CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 88.0f);

            CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];

            CGFloat height = MAX(size.height, 35.0f);

            return height + (CELL_CONTENT_MARGIN * 2) + 28.0f;
        }else{
            return 100.0f;
        }


    }

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {


        // Return 1 section which will be used to display the giant blank UITableViewCell as defined
        // in the tableView:cellForRowAtIndexPath: method below
        if ([self.postsArray count] == 0){

            return 1;

        } else if ([self.postsArray count] < 25) { //self.webServiceDataModel.total

            // Add an object to the end of the array for the "Load more..." table cell.
            NSLog(@"postsArray count: %i", [postsArray count]);
            return [self.postsArray count] + 1;
            NSLog(@"postsArray count after +1: %i", [postsArray count]);

        }   
        // Return the number of rows as there are in the postsArray Post data is empty.
        return [self.postsArray count];

    }
  • 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-20T10:52:05+00:00Added an answer on May 20, 2026 at 10:52 am

    [indexPath row] - 1 is the problem,

    For indexpath.row=0 it will be -1.

    [array objectAtIndex:-1] is exception. So crash occurs.

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

Sidebar

Related Questions

This is driving me crazy. I have this one php file on a test
This is driving me crazy. I'm not going to take it anymore. I'm going
I'm using .Net 2.0 and this is driving me crazy but there's probably some
This has been driving me crazy for a few days. Why doesn't the following
This is driving me nuts. I am using some 3rd-party code in a Windows
Total newbie question but this is driving me mad! I'm trying this: myInt =
NHibernate is driving me 'Nuts'!!! I have the following mapping. Which returns this error
Ok, this is driving me nuts. I've done just about everything I can to
This issue is driving me mad. I have several tables defined, and CRUD stored
This is a bit of a long shot, but if anyone can figure it

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.