• 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
Re: How to use NSMutableArray's filteredArrayUsingPredicate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use NSMutableArray's filteredArrayUsingPredicate


  • Subject: Re: How to use NSMutableArray's filteredArrayUsingPredicate
  • From: Eric Gorr <email@hidden>
  • Date: Tue, 18 Dec 2007 23:16:39 -0500

Well, this was easier then I thought.

Unless there is something about this solution that does not work, the answer appears to be:

NSArray *filteredArray = [myArray filteredArrayUsingPredicate: [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"Abbreviation LIKE \"%@\"", lookFor]]];

If there are any other interesting, I would be interested.
If there is any wrong with this one, I would be interested.


On Dec 18, 2007, at 10:46 PM, Eric Gorr wrote:

I've got a NSMutableArray filled with NSDictionary's with two keys (@"Abbreviation" & @"Index" ) whose values are NSString's.

What I would like to do is be able to use filteredArrayUsingPredicate on this array and have a new array containing only those elements where Abbreviation was 'Po'.

I assume this is possible and relatively easy if you already know the answer...however, I do not and was hoping someone could tell me how to accomplish this.
_______________________________________________

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


  • Follow-Ups:
    • Re: How to use NSMutableArray's filteredArrayUsingPredicate
      • From: "stephen joseph butler" <email@hidden>
References: 
 >How to use NSMutableArray's filteredArrayUsingPredicate (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Dir of app
  • Next by Date: Re: How to use NSMutableArray's filteredArrayUsingPredicate
  • Previous by thread: How to use NSMutableArray's filteredArrayUsingPredicate
  • Next by thread: Re: How to use NSMutableArray's filteredArrayUsingPredicate
  • Index(es):
    • Date
    • Thread