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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:30:55+00:00 2026-05-20T05:30:55+00:00

I am both new here and in IOS programming, so please bear with my

  • 0

I am both new here and in IOS programming, so please bear with my newbee questions for a while :]

Here is the situation of my application before my question:

I have a view in which i added 3 different subviews. (1-categories, 2-words and 3-rules)
Within the categories subview I have a table of categories. (reads and writes from a categories plist and array)

According to the selected category I am changing the table ingredients for words table in the words subview. This table keeps the words the user enters for a selected category. (reads and writes from an nsmutabledictionary whose keys are the category names from the categories table and whose values are arrays of strings which were pre-entered by me to the plist)

Now an example to make things clear:
my categories array has: Size, Color
my words array for Size category has 3 strings in it like so: “tiny” , “big”, “huge”
my words array for Color category has 2 strings in it like so: “red”, “blue”

First when i select “Size” category, i go and fetch words within that category and when i move from categories subview to words subview i see everything inside the “Size” category correctly in my uitableview. (it prints “tiny”, “big” and “huge”)

But when i go back to my categories subview and select “Color” this time and go back to words subview i get a crash.

Seems like it calls tableView:cellForRowAtIndexPath: method, and i get an NSRangeException as below:

[NSMutableArray objectAtIndex:]: index 2 beyond bounds

Long story short, I want to know why the cellForRowAtIndexPath method is calling an index which is not there. Here is how inside my cellForRowAtIndexPath method looks like:

[self reinitializeWordsDictionary];
[self reinitializeWordsInSelectedCategoryArray];

static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {
    cell = [[[UITableViewCell alloc] 
        initWithStyle:UITableViewCellStyleDefault 
        reuseIdentifier:CellIdentifier] autorelease];
}

cell.textLabel.text = [wordsInSelectedCategoryArray objectAtIndex:indexPath.row];

return cell;

Thanks in advance for the answers,

tiw

  • 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-20T05:30:55+00:00Added an answer on May 20, 2026 at 5:30 am

    Sounds to me that the - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
    method of the UITableView‘s data source is delivering wrong values. I would check that by setting a break point on this method and evaluate the returned values.

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

Sidebar

Related Questions

At a new job I started, we have both a Java application that handles
We have a large enterprise consisting of many apps both old and new backed
I have been involved in a lot of projects, both old and new, and
I'm new to both Silverlight and RIA. I have a simple form with a
I am new to both sockets and threads. I have this code: listen(socket_fd, 20);
I'm new to both Web Services and RMI and I wonder which is the
I'm new to both ASP.Net MVC and jQuery and what I'm trying to do
New to both Ruby and Rails but I'm book educated by now (which apparently
I'm new to both C# and Linq. I'm attempting to use a Linq-generated element
I'm very new to both the Mvc framework as well as JavaScript and JQuery.

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.