• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Extending NSMutableDictionary what am I doing wrong?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extending NSMutableDictionary what am I doing wrong?


  • Subject: Re: Extending NSMutableDictionary what am I doing wrong?
  • From: mmalcolm crawford <email@hidden>
  • Date: Sun, 29 Feb 2004 12:01:59 -0800

On Feb 29, 2004, at 11:26 AM, mmalcolm crawford wrote:
On Feb 29, 2004, at 5:09 AM, Greg Hurrell wrote:
I can't for the life of me think why you want a "Page" object that behaves like a dictionary...
Put like that, fair enough, but:

Actually, even "putting it like that" is probably not fair. The whole basis of key-value coding is to allow any object behave like a dictionary (<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Protocols/NSKeyValueCoding.html>). It's also not too difficult to imagine that an object might store its instance variables not "explicitly", but in a internal dictionary. Accessor methods would get/set the appropriate entry:

- (NSString *)name
{
return [ivarDict objectForKey:@"name"];
}

This pattern is adopted in WebObjects for the implementation of EOGenericRecord: <http://developer.apple.com/documentation/WebObjects/Reference/API5.2/ com/webobjects/eocontrol/EOGenericRecord.html>

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Extending NSMutableDictionary what am I doing wrong? (From: Stefan Pantos <email@hidden>)
 >Re: Extending NSMutableDictionary what am I doing wrong? (From: Greg Hurrell <email@hidden>)
 >Re: Extending NSMutableDictionary what am I doing wrong? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Preference dialog
  • Next by Date: Locating application bundle from a nib file
  • Previous by thread: Re: Extending NSMutableDictionary what am I doing wrong?
  • Next by thread: canCloseDocumentWithDelegate
  • Index(es):
    • Date
    • Thread