Talk:Filter: Difference between revisions

(task clarity, C# alternate example.)
(→‎Objective-C code: new section)
Line 1:
I fail to see where the "alternate" C# tests for evenness... [[User:Sgeier|Sgeier]] 23:43, 30 January 2007 (EST)
:Looks like the confusion stems from whether or not the "select even numbers" portion of the task description is required. I'll change the wording and remove the alternate C# example. --[[User:Short Circuit|Short Circuit]] 10:28, 31 January 2007 (EST)
 
== Objective-C code ==
 
Does it really works?! It does not on GNUstep, and looking at Apple's doc, I doubt it works for Mac OS X. NSPredicate does not cite the possibility of writing directly ''selectors-like string'' for NSExpression that way ([http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Predicates/Articles/pSyntax.html Cocoa predicates]); NSExpression has the expressionForFunction:arguments: where expressionForFunction can be @"modulus:by:" (and arguments is a NSArray) (see [http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSExpression_Class/Reference/NSExpression.html here]), but again, I've found no example about, nor citing, the fact that one can directly write a predicateWithFormat string expressing expressionForFunction ''directly'' with that syntax you've used, i.e. @"modulus:by:(SELF, 2)". Instead, I've tried a simpler @"intValue < 4" and it works like expected (the selector IntValue is for NSNumber object into the array...). GNUstep quirks or Cocoa facts? --[[User:ShinTakezou|ShinTakezou]] 18:16, 22 February 2009 (UTC)