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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:15:38+00:00 2026-06-11T01:15:38+00:00

I tried to search on Google or Stackoverflow but can’t find such an operator.

  • 0

I tried to search on Google or Stackoverflow but can’t find such an operator. In C we used to defined a cmp macro but is there something built in?

  • 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-11T01:15:39+00:00Added an answer on June 11, 2026 at 1:15 am

    As @Kashiv mentioned, 100% of C is available in Objective-C. However, if you are using the Cocoa Frameworks and are asking about a more “Cocoa” way of doing it, NSNumber has a compare: method, which returns an NSComparisonResult, which is either -1, 0 or 1.

    However, if we are being thoroughly Cocoa in our programming we should further abstract ourselves from the specific knowledge of -1, 0 and 1 and use the constants NSOrderedAscending, NSOrderedSame, and NSOrderedDescending. These are semantically named and that’s the real value in programming this way.

    NSComparisonResult order = [myInt compare:anotherInt];
    switch(order) {
      case NSOrderedAscending:
        // myInt is greater than anotherInt
      break;
      // ... etc
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to search in google but cannot find a complete solution (i only
I have tried to search for an answer in google, and this site, but
I tried to search SO but couldn't find close answers. What I have is
I tried to search for a JavaScript reference, but there's none available. The best
For example: x := #123; I tried to search around Google but I simply
I tried to search it on google but no one was matched to my
I have tried to search Google and look in the manual, but still cannot
i tried to search this but was not able to get any proper help.I
I've tried to search for a solution for this, but have had no joy:
I've tried a few google searches and stack over flow searches, but this is

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.