Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 16, 2009, 12:32 PM   #1
stadidas
macrumors regular
 
Join Date: Feb 2006
Location: Kent, United Kingdom
NSPredicateEditor Issues

Hi all,

I have been having fun today with NSPredicateEditor, but have run in to a couple of problems.
In Interface Builder I have an NSPredicateEditorRowTemplate setup to accept Number inputs. However, the default implementation creates the row template with the rightExpressionAttributeType set to NSInteger64AttributeType. I need to set it to NSDecimalAttributeType in order to evaluate the predicate with decimal values. The problem is I can not find out where to set or initialise this value. None of the listed init methods appear to be called in my row template subclass that I created to try and solve this problem.

I am also having an issue when an NSPredicateEditorRowTemplate is set to take date inputs. When a date is set, the array I am filtering using the created predicate is filtered with only objects that match the exact date including the time i.e if the date in the row template is set to today, only objects with a date that is today at midnight will be included after filtering. Does anyone know how to customise this behaviour so that it will include objects where the date is the same, but the time isn't?

As always, any help will be gratefully received
stadidas is offline   0 Reply With Quote
Old Mar 19, 2009, 02:00 PM   #2
stadidas
Thread Starter
macrumors regular
 
Join Date: Feb 2006
Location: Kent, United Kingdom
It's been two days, and I'm no closer to fixing these issues. Doesn't anyone have any experiecne with NSPredicateEditor?
stadidas is offline   0 Reply With Quote
Old Mar 19, 2009, 02:38 PM   #3
Bakerman
macrumors member
 
Join Date: Jan 2005
Location: Sweden
I'd say the solution to both your problems involves subclassing. Unfortunately in many cases the available methods to override are insufficient; I've had to resort to meddling with the actual predicate string. Overriding both setPredicate and predicateWithSubpredicates will let you do this...
Bakerman is offline   0 Reply With Quote
Old Mar 19, 2009, 05:35 PM   #4
stadidas
Thread Starter
macrumors regular
 
Join Date: Feb 2006
Location: Kent, United Kingdom
OK, thanks; I will look into this. It seems odd that there is no way in IB or code to set the rightExpressionAttributeType to decimal though.
stadidas is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
OS X printing sharing issue WRXface Mac OS X 1 Feb 25, 2011 06:44 PM
Another screen issue thread: I can't find one that has the same issues carreragt7 MacBook 5 Jan 2, 2011 11:14 AM
Canon 60D issue - horizontal banding on dark colours Schtumple Digital Photography 13 Dec 25, 2010 03:57 AM
MacBook Pro Unibody bootup issue, videos included MIDI_EVIL MacBook Pro 14 Dec 9, 2010 12:58 PM
Heating issues? tljuly3 MacBook Air 4 Nov 16, 2010 06:16 PM


All times are GMT -5. The time now is 01:33 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC