xuedroid
xuedroid

Reputation: 1

TrueVault iOS SDK TVQuery with TVSort Returning 400 in Swift

I have setup a Swift project with the TrueVault iOS SDK. When running this code, it returns with kTrueVaultErrorDomain error 400:

var query : TVQuery = MDRequest.queryWithFilters(filters)
query.sorts = [TVSort(descendingWithKey:"date")]
query.findObjectsWithCompletionHandler {...}

However, if I do not include the TVSort line, it works fine:

var query : TVQuery = MDRequest.queryWithFilters(filters)
query.findObjectsWithCompletionHandler {...}

There's something about setting up the sort. In ObjC it works fine (as in with the truevaultdemoapp). What could be the cause? I've tried using NSArray instead but still same problem. What could be happening?

Upvotes: 0

Views: 107

Answers (1)

Dan Cleary - TrueVault
Dan Cleary - TrueVault

Reputation: 111

Change descendingWithKey to sortDescendingWithKey and see if that works.

Upvotes: 0

Related Questions