• 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
filteredArrayUsingPredicate and points
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filteredArrayUsingPredicate and points


  • Subject: filteredArrayUsingPredicate and points
  • From: Alexey Baev <email@hidden>
  • Date: Wed, 15 Apr 2009 17:05:33 +0300

Hi.

I have class MyDot. This class has function:
- (BOOL) containsPoint: (NSPoint) pt;

I have also NSArray, which contains several MyDot objects:
NSArray* dots;

I want to get new array
NSArray* newDots
which contains MyDot objects and
for these dots containsPoint:(NSPoint)pt = YES.

How can I do that?

I would like to write something like that:

NSPoint checkedPoint = NSMakePoint(100, 100);

NSPredicate* predicate = [NSPredicate predicateWithFormat: @"containsPoint %p == YES ", checkedPoint]; //i don't know what to write here

NSArray* newDots = [dots filteredArrayUsingPredicate: predicate];

I would be glad if you helped me.

--
Alexey Baev








_______________________________________________

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: filteredArrayUsingPredicate and points
      • From: Jim Turner <email@hidden>
    • Re: filteredArrayUsingPredicate and points
      • From: Keary Suska <email@hidden>
  • Prev by Date: unrecognized selector sent to instance
  • Next by Date: Re: String Allocation inside drawRect:...
  • Previous by thread: Re: unrecognized selector sent to instance
  • Next by thread: Re: filteredArrayUsingPredicate and points
  • Index(es):
    • Date
    • Thread