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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:50:39+00:00 2026-06-09T12:50:39+00:00

I need to search the index of a string from NSMutableArray . I have

  • 0

I need to search the index of a string from NSMutableArray. I have implemented the code & which works perfect, but I need to increase the searching speed than this.

I have used the following code:

NSIndexSet *indexes = [mArrayTableData indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop){
    NSString *s = (NSString*)obj;
    NSRange range = [s rangeOfString: txtField.text options:NSCaseInsensitiveSearch];
    if(range.location == 0)//
        return range.location != NSNotFound;
    return NO;
}];

NSLog(@"indexes.firstIndex =%d",indexes.firstIndex);
  • 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-09T12:50:41+00:00Added an answer on June 9, 2026 at 12:50 pm

    There is a method indexOfObject

    NSString *yourString=@"Your string";
    NSMutableArray *arrayOfStrings = [NSMutableArray arrayWithObjects: @"Another strings", @"Your string", @"My String", nil];
    
    NSInteger index=[arrayOfStrings indexOfObject:yourString];
    if(NSNotFound == index) {
        NSLog(@"Not Found");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to search for a partial match in an inverted index, following code
I need to rewrite an image path on the following URLs: domain.com/system/index domain.com/system/view/12345 domain.com/system/search/term1:/term2:data/term3:/term4:data/term5
I need to search a string in mysql with php. I get an error
I need to search for all users containing a certain text string in their
I have a custom delegate derived from QStyleOptionViewItem which is trying to draw multiline
I have a text file that I need to search and then print to
I have this string IP 1.2.3.4 is currently trusted in the white list, but
I need to search for certain users on Facebook by their names(ex. Full name
I need to search for the closest Dialcode bigger than the actual one. For
I need to search dates in mysql however, if the column type is date

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.