/Frameworks/OJMoq/CPArray+Find.j

http://github.com/hammerdr/OJTest · Unknown · 16 lines · 13 code · 3 blank · 0 comment · 0 complexity · a83a9e6fc0e53715a3b3b80b4eb0d0e4 MD5 · raw file

  1. @implementation CPArray (Find)
  2. - (CPObject)findBy:(Function)isTheObject
  3. {
  4. for(var i = 0; i < [self count]; i++)
  5. {
  6. if(isTheObject([self objectAtIndex:i]))
  7. {
  8. return [self objectAtIndex:i];
  9. }
  10. }
  11. return nil;
  12. }
  13. @end