Re: Extending NSMutableDictionary what am I doing wrong?
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.