• 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
Binding filterPredicate -- not working yet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding filterPredicate -- not working yet


  • Subject: Binding filterPredicate -- not working yet
  • From: Jeremy Faller <email@hidden>
  • Date: Wed, 19 Jul 2006 18:46:43 -0400

All:

I am having a problem using an NSArrayController 'filterPredicate' bound in IB. Here's what's happening:

- My NSArray and NSPredicate live in the document. They are accessed through the 'File's Owner'.
- For simplicity, the objects in the array contain 3 fields, let's call them "firstName" "lastName" and "type".
- If I just display the first and last names in a tableview, everything is fine, when I add the filterPredicate that is returned from my document class, I get no objects populating in my table.
- My predicate looks like:


[self setValue:[NSPredicate predicateWithFormat:@"type < 3"] forKey:@"fooPredicate"];

- I bind the "filterPredicate" to "fooPredicate" and nothing gets displayed in my table view.

Two other notes, the 'type' is stored as an integer in the object I am trying to display NOT an NSNumber. I'm not sure if this is a problem. (Maybe I will investigate this while awaiting an answer...) Additionally, I am not changing the filter predicate at runtime. (I am comfortable with 2 NSArray controllers splitting my data into two sets unless there is cleaner mechanism.)

Does anyone know if I am I doing wrong? Is there a simpler way I could do this? Are there any examples out there doing what I am trying to do? Most examples I have found bind filterPredicate to a search field.

Thanks in advance everyone.

Best Regards,
Jeremy R. Faller
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: CoreImage - problems with larger images
  • Next by Date: NSBrowser cell reference
  • Previous by thread: Creating Custom Bundle File Format
  • Next by thread: Re: Binding filterPredicate -- not working yet
  • Index(es):
    • Date
    • Thread