• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
is there some disadvantage to predicateWithBlock?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

is there some disadvantage to predicateWithBlock?


  • Subject: is there some disadvantage to predicateWithBlock?
  • From: Matt Neuburg <email@hidden>
  • Date: Tue, 13 Dec 2011 10:15:44 -0800

I've been saying e.g. this:

    NSPredicate* p = [NSPredicate predicateWithBlock:
     ^BOOL(id obj, NSDictionary *d) {
         NSString* s = obj;
         return ([s rangeOfString:searchBar.text
             options:NSCaseInsensitiveSearch].location != NSNotFound);
     }];
    self.filteredStates = [states filteredArrayUsingPredicate:p];

I'm having a doubt. Is there some reason why I should have been using indexesOfObjectsPassingTest: instead? Thx - m.

--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: bindings duplicates object returned
  • Next by Date: Re: bindings duplicates object returned
  • Previous by thread: Re: How select NSTextField programatically?
  • Next by thread: Updating an app's help
  • Index(es):
    • Date
    • Thread