Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>NSDictionary</code> is a class cluster, as Gendolkari said and <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html" rel="noreferrer">Class Clusters are documented</a>.</p> <p>And, no, you can't depend on the exact identity of the private subclass. </p> <p>You should certainly be able to do the following to determine if it is a dictionary or not:</p> <pre><code>[myThingaMaHoover isKindOfClass: [NSDictionary class]]; </code></pre> <p>Or, at the least, that it is a dictionary as implemented as a part of the <code>NSDictinoary</code> class cluster.</p> <p>What you can't do is use <code>isKindOfClass:</code> or <code>isMemberOfClass:</code> to determine whether or not a dictionary (or string, array, or set) is mutable. Consider:</p> <pre><code>NSDictionary *d = [NSDictionary dictionaryWithObject: [[NSObject new] autorelease] forKey: @"Bob"]; NSMutableDictionary *m = [NSMutableDictionary dictionaryWithObject: [[NSObject new] autorelease] forKey: @"Bob"]; NSLog(@"d class: %@ %@ %@", [d class], [d superclass], [[d superclass] superclass]); NSLog(@"m class: %@ %@ %@", [m class], [m superclass], [[m superclass] superclass]); </code></pre> <p>This outputs:</p> <pre><code>d class: NSCFDictionary NSMutableDictionary NSDictionary m class: NSCFDictionary NSMutableDictionary NSDictionary </code></pre> <p><code>d</code> and <code>m</code> are both instances of <code>NSCFDictionary</code> which inherits from <code>NSMutableDictionary</code> (which inherits from <code>NSDictionary</code>).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload