title: iOS 10 NSNumber crash with enumerations
body: <p>I am having a very weird issue relating to <code>NSNumber</code> objects for my enumerated values and access to them on a device running iOS os version 10. </p>
  
  <blockquote>
    <p>Just as a disclaimer - this issue does not happen in other iOS os versions.</p>
  </blockquote>
  
  <p>I have declared an enum like so:</p>
  
  <pre><code>typedef NS_ENUM(NSInteger, MYENUM) {
     FIRST = 1500,
     SECOND = 1700,
     THIRD = 1900,
     ...
  };
  </code></pre>
  
  <p>When using this enum, I am passing it along in this fashion:</p>
  
  <pre><code>[[MyObject alloc] initObjectWith:@(FIRST)];
  </code></pre>
  
  <p>Excluding the inner logic, I am using the enum in a dictionary and thus need to convert it to a NSNumber.</p>
  
  <p>While doing so, the application crashes, because the enum is somehow not a NSNumber, but rather a NSIndexPath.</p>
  
  <p><a href="https://i.stack.imgur.com/BxUFh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BxUFh.png" alt="Screenshot"></a></p>
  
  <p><strong><em>Why does this happen?</em></strong></p>
  
  <p>When I remove the boxed literal and change the method signature to accept a NSInteger, this crash disappears.</p>
  
  <p>I have tried searching online for this type of issue, but have come up short.</p>
  
  <p><strong><em>Further Explanation (per comment)</em></strong></p>
  
  <p>No special logic happens inside the init method for myObject, just  assigning the property which is defined as a <code>NSNumber</code> to the parameter that is passed.</p>
  
  <p>Regarding the crash log, Xcode is infamous in providing not so useful crash logs and all I am seeing is <code>EXC_BAD_ACCESS</code>, which could either mean accessing an object that has been released or a potential memory leak.</p>
  
  <p>The MyObject class is defined as follows:</p>
  
  <p>header file:</p>
  
  <pre><code>@interface ISNEvent : NSObject
  
  @property(nonatomic, assign) NSNumber* number;
  
  -(instancetype)initObjectWith:(NSNumber*)number;
  
  @end
  </code></pre>
  
  <p>.m file:</p>
  
  <pre><code>- (instancetype)initObjectWith:(NSNumber*)number {
     self = [super init];
     if (self) {
       _number = number;
     }
  
     return self;
  }
  </code></pre>