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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:18:43+00:00 2026-05-20T22:18:43+00:00

I would appreciate some help. I have used this before and it worked fine.

  • 0

I would appreciate some help. I have used this before and it worked fine. I tried to use it in a new app and it breaks. I understand it is a problem with the index, but I can’t pin point it.

    self.greensArray = [NSMutableArray array];
    for (int i = 0; i < 26; ++i) {
    [self.greensArray addObject:[NSMutableArray array]];
    }


letterIndex =[[NSMutableArray alloc] init];

NSMutableArray *name = [searchViewArray valueForKey:@"meatName"];
for (int i = 0; i < [name count]; ++i) {
    NSUInteger firstLetter = [ALPHA rangeOfString:[[name objectAtIndex:i ] substringToIndex:1]].location;
    [self.greensArray insertObject:[NSMutableArray array] atIndex:i];
    if (firstLetter != NSNotFound) {
        [[self.greensArray objectAtIndex:firstLetter] addObject:[name objectAtIndex:i]];
    }
    char alphabet = [[name objectAtIndex:i] characterAtIndex:0];
    NSString *uniChar = [NSString stringWithFormat:@"%C",alphabet];
    if(![letterIndex containsObject:uniChar])
    {
        [letterIndex addObject:uniChar];

    }
}
  • 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-20T22:18:44+00:00Added an answer on May 20, 2026 at 10:18 pm

    The problem was here: [self.greensArray insertObject:[NSMutableArray array] atIndex:i];
    I don’t know why this worked in my first application, but this line of code added additional values to the greensArray. That threw off the integer / meatName count and made the whole app crash.

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

Sidebar

Related Questions

I have a problem finding references to this subject and would appreciate some help.
I would appreciate some help with something I working on and have not done
I'm pretty new to Python programming and would appreciate some help to a problem
I would appreciate some help with an UPDATE statement. I want to update tblOrderHead
I would really appreciate it if some of you could help optimize my tables,
I would appreciate some guidance on modelling services and operations in WCF. I have
I have a design issue that I would appreciate some input on. I would
I would appreciate any help on this issue. Lets say I want to load
I would really appreciate some feedback on what I am trying to achieve: The
I have an interesting problem and would appreciate your thoughts for the best solution.

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.