• 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
predicate with smallest x-coordinate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

predicate with smallest x-coordinate?


  • Subject: predicate with smallest x-coordinate?
  • From: Bob Ueland <email@hidden>
  • Date: Thu, 8 Nov 2007 07:17:06 -0800 (PST)

I have a Fish class with two ivars declared like this

@interface Fish : NSObject
{
    NSString *name;
    NSRect frame;
}
....


I create a NSMutableArray which contains a number of Fish objects. When I want to filter out all Fish objects whose name begins with letter B i use

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name beginswith 'B'"];


That works. But now I want to filter out the Fish that has the smallest x-coordinate (that is the smallest frame.origin.x). How should I write my predicate?

Thanks Bob




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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

  • Follow-Ups:
    • Re: predicate with smallest x-coordinate?
      • From: David Spooner <email@hidden>
  • Prev by Date: Re: Swapping contents of windows from nibs
  • Next by Date: Changing settings in System Preferences using cocoa api
  • Previous by thread: Re: NSOpenGLView overlap
  • Next by thread: Re: predicate with smallest x-coordinate?
  • Index(es):
    • Date
    • Thread