You actually don't even technically have to be KVC-compliant (read: implements NSKeyValueCoding), because it will fall back to using reflection.  You can just potentially provide a faster implementation if you implement NSKeyValueCoding yourself.

ms

On Jun 30, 2006, at 12:53 PM, Robert Walker wrote:

Yes, using EOQualifier.filteredArrayWithQualifier(someArray, someQualifier) is the way to go.  Assuming that the objects contained within the NSArray are Key Value Coding (KVC) compliant.

Just thought I would add that clarification.  If they are not KVC compliant then you need to write your own custom filtering algorithm.

On Jun 30, 2006, at 12:03 PM, Sam Barnum wrote:

I'd recommend filtering the item in the java code.  You can use an EOQualifier to do this rather easily.

For example, to filter out items whose "status" attribute value is "hidden", you could use something like the following:

public NSArray filteredItems() {
return EOQualifier.filteredArrayWithQualifier(initialArray, new EOKeyValueQualifier("status", EOQualifier.QualifierOperatorNotEqual, "hidden"));
}

For more complicated filtering, you can use EOQualifier.qualifierWithQualifierFormat to build your qualifier.

--
Sam Barnum
360 Works
415.865.0952



On Jun 29, 2006, at 2:28 PM, Paul Lynch wrote:


On 29 Jun 2006, at 22:13, Gavin Eadie wrote:

I want to display the contents of an NSArray and WORepetition is the perfect dynamic element to do that.  However, I want to complicate the world and be able to suppress some of the entries based on some computation performed on each Array element.

It seems I can do this at least two ways:

(1) ... filter the original NSArray through the computation to make a new NSArray and use that.

(2) ... play games with the processing of the WORepetition so it skips items.

Or (2), use a WOConditional within the repetition to do the filtering for you.  This is sort of 'playing games', but unfortunately it's easy rather than hard.

Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

--
Robert Walker



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to