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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:59:06+00:00 2026-05-25T17:59:06+00:00

I want to compare an array containing int values to a number example [1,2,30,1,40,200,10,500]

  • 0

I want to compare an array containing int values to a number

example [1,2,30,1,40,200,10,500] < 500 meaning if array contains elements less than 500.

How can i do dis?

Thank alot in advance

I did this bt it say invalid opernd:

if ([placeName count])
{
    for (int i =0; i < [placeName count]; i++) 
    {
        NSArray *sortedArray=[placeName sortedArrayUsingFunction:intSort context:NULL];
        self.placeName = [NSMutableArray arrayWithArray:sortedArray];

        NSMutableArray *tempArray = [sortedArray objectAtIndex:i];

        NSDecimalNumber *Distance = [tempArray objectForKey:@"distance"];

        NSMutableArray *intDistanse=[Distance intValue];
        DLog(@"Distance%d", intDistanse);

        NSMutableArray *intDistanse=[Distance intValue];
        DLog(@"Distance%d", intDistanse);

        for(int j = 0; j < [intDistanse count]; j++)
        {
             if ( intDistanse[j] < 500 ) //here its says error
             {

                DLog(@"success");

             }
        }
    }
}
  • 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-25T17:59:06+00:00Added an answer on May 25, 2026 at 5:59 pm

    Did find a solution to it type casting:

    NSMutableArray *tempArray = [sortedArray objectAtIndex:i];
            //DLog(@"sortedArray%@", sortedArray);8=
            NSNumber *DistanceNum = [tempArray objectForKey:@"distance"];
            NSLog(@"distance%@:::",DistanceNum);
            NSInteger intDistance = (int)[DistanceNum floatValue];
    
            if(intDistance<500)
            {
                NSLog(@"h:)");
                NSString *notifications =@"Yes";
                [[AppHelper mDataManager] setObject:notifications forKey:@"notifications"]; 
    
                NSLog(@"notifications:%@",notifications);
                RemindMeViewController *object = [[RemindMeViewController alloc] initWithNibName:@"RemindMeViewController" bundle:nil];
                //  RemindMeViewController *object=[[RemindMeViewController alloc]initWithNibName];
    
                NSLog(@"notifications set");
                [object scheduleNotification];
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have an array having elements am,john,rosa,freedom . I want to compare these
Hi i want to compare all the values of 2 arrays and end up
I want to compare the keys in a hash of parameters against an array
I want to get all keys of the array an compare each key to
Suppose I have a sorted array of integers int[] , and I want to
I have an array of objects and I want to compare those objects on
How would like to to compare values in this nested foreach. I want to
I want to compare varbinary type with byte array. I have tried so far:
I want to compare an array of modified records against a list of records
I want to compare an array of comparables. The simplest way seems the following

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.