bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: valueForKey: on an NSArray


From: David . Ayers
Subject: Re: valueForKey: on an NSArray
Date: Fri, 5 Apr 2002 12:48:44 +0200

[...snip...]
I think that you are talking about webobjects specific behavior.  You
can tell this by the fact that this
is only documented in the webobjects documentation, and the fact that it
doesn't work like this in MacOS-X
  (I checked by running a test program on MacOS-X 10.1.3).

It looks to me like most (if not all) of the methods in your source file
are webobjects specific ones
which are not present in the apple Foundation.
[...snip...]
I think this means the basic KVC stuff should be in the base library,
with webobjects extensions in gsweb
and eof extensions in gdl2.
...
>>


In gdl2, the value returned is an array ofvalues resulting of calling
valueForKey: on each object of the array
except for functions (keys beginning with @) and 'count' key.
[...snip...]

OS42 Implements the NSArray_Category in EOControl/EOValueCoding.h

// EOKeyValueCoding.h
// Copyright (c) 1994, NeXT Software, Inc.  All rights reserved.

[...snip...] (hope I'm not infringing anything here)

@interface NSArray (EOKeyValueCoding)
- (id)valueForKey:(NSString *)key;
    // When passed a "normal" key, returns an array composed of the
    // results of calling valueForKey: on all elements of the array.
    // When passed a key prefixed with "@" a single value is returned
    // which is the result of invoking an aggregate function on the values
    // of the array.
    // For instance, when passed @sum.budget, it will invoke
-computeSumForKey:@"budget"
    // on the array.  The following aggregates are defined:
    //    @sum, @count, @avg, @min, @max
    // New methods added in categories on NSArray will automatically be
detected
    // by the connection inspector in InterfaceBuilder.

- (id)computeSumForKey:(NSString *)key;
- (id)computeAvgForKey:(NSString *)key;
- (id)computeCountForKey:(NSString *)key;
- (id)computeMaxForKey:(NSString *)key;
- (id)computeMinForKey:(NSString *)key;

@end

And therefore this should best be implemented in db/eoaccess in my opinion.








Manuel
--
______________________________________________________________________
Manuel Guesdon - ORANGE CONCEPT <mguesdon@orange-concept.com>
14 rue Jean-Baptiste Clement  -  93200 Saint-Denis  -  France
Tel: +33 1 4940 0997  -  Fax: +33 1 4940 0998


_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnustep






reply via email to

[Prev in Thread] Current Thread [Next in Thread]