[MacRuby-devel] NSPredicate crash

Alan Skipp al_skipp at fastmail.fm
Thu Jan 6 11:14:27 PST 2011


Hi everyone,
Has anyone had any trouble with NSPredicate causing occasional crashes when used with NSArrayController? Well actually about 50% of the time. 

What I have is a subclass of NSArrayController which is a data source for an NSTableView that accepts drag and drop operations. In 'awakeFromNib' a NSPredicate is defined, sometimes the error is just, “EXC_BAD_ACCESS”, other times there's a bit more info:

data_source.rb:20:in `awakeFromNib': NSInvalidArgumentException: Unable to parse the format string "AND" (RuntimeError)

This is the offending line:
@filter_predicate = NSPredicate.predicateWithFormat("file_type == 'NSFileTypeRegular'")

The crash doesn't always occur, when it doesn't my app works without any problems. I've tried the predicate in macirb and the crash doesn't occur!?

Best regards,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110106/10f57e27/attachment.html>


More information about the MacRuby-devel mailing list