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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:38:33+00:00 2026-05-27T15:38:33+00:00

If I store an NSNumber that is equal to 0 in an NSMutableArray will

  • 0

If I store an NSNumber that is equal to 0 in an NSMutableArray will that be interpreted as nil and cause issues with the count method?

  • 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-27T15:38:33+00:00Added an answer on May 27, 2026 at 3:38 pm

    No, you have to differentiate between the object id itself and the contents. The contents of an NSNumber set to 0 may well be zero but the id for said object is actually a real address.

    For example, the object id 0x2222 may look like this in memory (very simplified):

               +--------+
    0x2222 --> | 0x0000 |
               +--------+
    

    You can see the the object id is not zero but a real value. The contents of the object are zero but that’s not relevant to the object id.

    The things that goes in the mutable array are the id values for objects, not the contents of those objects.

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

Sidebar

Related Questions

The documentation says, that core data properties can only store NSString, NSNumber and NSDate
I store some dates in my NSMutableArray, I want to retrieve them and change
I'm using NSUSerDefaults to store user preferences. I remember reading somewhere that setting the
I am trying to increment a number in a simple way that won't cause
I've got an issue that's been bothering me. I have to store information from
How do I store a NSUInteger using the NSCoding protocol, given that there is
my partial code to store location with image. CLLocation *location = self.filteredLocation ; NSNumber
I want to store a couple of sockets in an ArrayList/NSMutableArray, but the sockets
I have this little code NSMutableArray *myArray = [[NSMutableArray alloc] init]; NSNumber *myNumber =
Store everything in GMT? Store everything the way it was entered with an embedded

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.