Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're trying to subclass NSMutableDictionary? There's a blog entry for that!</p> <p><a href="http://cocoawithlove.com/2008/12/ordereddictionary-subclassing-cocoa.html" rel="nofollow noreferrer">http://cocoawithlove.com/2008/12/ordereddictionary-subclassing-cocoa.html</a></p> <p>First bit of advice?</p> <blockquote> <p>Best practice: don't subclass</p> </blockquote> <p>He's right. Trying to subclass a class not designed to be subclassed in Cocoa is usually harder than you think it'll be, and 99% of the time isn't necessary anyway. </p> <hr> <p>Looking at the code you posted, it doesn't look like you need to subclass anyway. Create a class that implements the title and begins methods and use a dictionary to handle the underlying storage.</p> <p>edit2: Clarified my last statement about subclassing. Some classes in Cocoa are designed to be subclassed (UIViewController, NSObject) and do so willingly, others are not designed to be subclassed and require a lot of careful coding (and in some cases, inside knowledge of how the objects work) to get them to work correctly. Bottom line: unless you're subclassing one of the classes designed for it, be careful and consider other alternatives (<a href="http://en.wikipedia.org/wiki/Decorator_pattern" rel="nofollow noreferrer">decorator class</a>, <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC//Articles/ocCategories.html#//apple_ref/doc/uid/TP30001163-CH20-SW1" rel="nofollow noreferrer">categories</a>, <a href="http://en.wikipedia.org/wiki/Delegation_pattern#Objective-C_example" rel="nofollow noreferrer">delegation</a>, <a href="http://doronkatz.com/objective-c-about-notifications" rel="nofollow noreferrer">notification</a>, etc.)</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.
 

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