I've been struggling with getting the information entered in an NSPredicatEditor
from session to session in a Swift
project.
Any guidance or samples would be greatly appreciated.
What I've got so far.
- A predicate editor that is functional implemented in an Action Sheet.
- Bound predicate to an NSArrayController also bound to a CoreData Table.
- A method to generate Row Templates based on CoreData Table Attributes.
What is not working.
- A bound predict variable to the
predicateditor
getting error on not being able to match the predicate to a row template also at theawakefromnib
seems to be where this is checked the row templates are not initialised (nil )at this point from the InterfaceBuilder
What I want to be able to do
Using the NSUSerDefaults
persist the contents of the predicate editor so that when the application is re-started this editor has the data last entered.
Load the previously saved predicate by setting the editor's
objectValue
property.It sounds like you may have a complicated setup involving Interface Builder, array controllers, Core Data, bindings, etc. Try it through code instead: load the row templates, then load the predicate.