Skip to content

Swift dynamic cast failure #22

Description

@dirkfabisch

When I try to us the non NSPredicate notation I get an Swift dynamic cast failure.

#1  0x0000000103153d7e in QueryKit.< infix <A>(QueryKit.Attribute<A>, A) -> ObjectiveC.NSPredicate at /Users/dirk/Development/Test_App/dummyDB/Pods/QueryKit/QueryKit/Attribute.swift:59

Working code

var predicate = NSPredicate(format: "age == 42")
var qs2 = Person.queryset(moc).filter(predicate!)

Error code

var qs = Person.queryset(moc).filter(Person.attributes.age == 42)

Model is

Entity:Person
Attribute:age::NSNumber
Attribute:name::String

Build with mogenerator template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions