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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:27:22+00:00 2026-06-09T16:27:22+00:00

I am trying to divide NSInteger with some number, but I am receiving errors.

  • 0

I am trying to divide NSInteger with some number, but I am receiving errors.

This is what I am trying to do:

length = [corner count];
for (int i=0; i<length; i++) {
    if ([resultDate rangeOfString:[corner objectAtIndex:i]].location != NSNotFound) {
        cornerResult++;
    }
}

cornerResultLabel.text = [NSString stringWithFormat:@"%i", cornerResult];

This works as it should.. I search through the array and count the results and write it.

But, I need cornerResult divided with 4. When I add cornerResult / 4 it shows me the error(as I wrote in comment). I have no idea why is this making problem.

  • 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-09T16:27:23+00:00Added an answer on June 9, 2026 at 4:27 pm

    you probably meant to divide the intValue of the NSNumber, not the NSNumber* itself:

    int num = number.intValue;
    int result = num / 4;
    

    (full code sample and error message would help)

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

Sidebar

Related Questions

I'm trying to divide some large numbers in Python but i'm getting some strange
I'm currently trying to divide counts[email] a hash containing the number 82,000 by a
Trying to understand why this doesn't work. I keep getting the following errors: left
I'm trying to divide my monolithic, Delphi-Win32 app in libraries, so I get some
I'm trying to catch a divide by 0 arithmetic exception in my code but
I am trying to divide arrays recursively... I think that is what this would
I am trying to divide integers but get 0 as result. I just do
I'm trying to divide 2 integers but the results returns zero no matter what.
I was trying this piece of code to check whether the divide by zero
I am trying to divide my 2 number. And I determine them with different

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.