Skip to content

Can't create YapDatabaseQuery in Swift #170

@jj0b

Description

@jj0b

I'm struggling to create a query in Swift and I'm not sure if this is due to a bug or a lack of understanding of how to create a query.

I've added the YapDatabase extension detailed in the YapDatabaseQuery header and I've tried:

var query: YapDatabaseQuery = YapDatabaseQuery(format: "WHERE authToken IS NOT NULL", arguments:nil)

this gives the error:

Cannot find an initializer for type 'YapDatabaseQuery' that accepts an argument list of type '(format: String, arguments: nil)'

I assumed this was because arguments need to be Objective-C types according to the header, so I then tried this:

var query: YapDatabaseQuery = YapDatabaseQuery(format: "WHERE authToken ?", arguments:NSString(string: "IS NOT NULL"))

But I still get an error even with passing an NSString:

Cannot find an initializer for type 'YapDatabaseQuery' that accepts an argument list of type '(format: String, arguments: NSString)'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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