Malakim
Malakim

Reputation: 1343

NSPredicate issue in Swift 1.2

Since updating my project to Swift 1.2 - I'm getting a "EXEC_BAD_ACCESS (code=1, address=...) exception when creating a NSPredicate instance.

This is how I create it:

var predicate = NSPredicate(format: "width = %@ AND height = %@ AND lang = %@", width, height, language)

All the arguments have values. Any ideas what have changed in 1.2 that is causing this to fail?

Upvotes: 1

Views: 216

Answers (1)

Javier Flores Font
Javier Flores Font

Reputation: 2093

Try %d for width and height

var predicate = NSPredicate(format: "width = %d AND height = %d AND lang = %@", width, height, language)

Upvotes: 1

Related Questions