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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:27:11+00:00 2026-06-16T03:27:11+00:00

Coding for iOS apps, I find there is potential reason to prohibit inheriting NSNumber,

  • 0

Coding for iOS apps, I find there is potential reason to prohibit inheriting NSNumber, NSNull, …blabla.

If I try to do this, compiler does not fail but running will crash at once without any usage info, does anyone know the reason?

  • 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-16T03:27:12+00:00Added an answer on June 16, 2026 at 3:27 am

    Subclassing Notes

    As with any class cluster, if you create a subclass of NSNumber, you
    have to override the primitive methods of its superclass, NSValue.
    Furthermore, there is a restricted set of return values that your
    implementation of the NSValue method objCType can return, in order to
    take advantage of the abstract implementations of the non-primitive
    methods. The valid return values are “c”, “C”, “s”, “S”, “i”, “I”,
    “l”, “L”, “q”, “Q”, “f”, and “d”.

    More precisely, I believe it’s because you never actually have an instance of NSNumber. Objective-C has the interesting property that the initializer of a class can actually change the object to which self points (this might actually be true of any method, but I’ve only ever heard of it being used in the init methods). I believe that NSNumber does this very thing.

    See also the documentation on Class Clusters.

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

Sidebar

Related Questions

Is it possible to create responsive, mobile-style apps without coding directly for iOS or
New to iOS coding, so this is probably more of a syntax question than
I'm coding Settlers of Catan for iOS and currently have my data tiles in
I'm trying to add some simple peer-to-peer connection functionality to an iOS library. Coding
Coding footer naively, if there's not enough content, then there will be empty space
I'm pretty new to coding for iOS and i have a question about setting
I have just started developing apps on iOS, I would just like to know
while coding in iOS 4.3 before, I found while add a view controller's view
I'm coding an app for iOS / WP7 / Android using PhoneGap and it
I'm coding iOS app that will explain complex numbers to the user. Complex numbers

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.