我正在创建一个与 salesforcemobilesdk-ios 集成的 ipad 应用程序。对于离线功能,我正在使用 smartStore 框架。在创建汤时,我正在传递 SFSoupIndex 的数组。
(即indecesArray)
你可以看到下面的代码。
let soupIndexForAccount__c = SFSoupIndex(path: "account__c", indexType: "string", columnName: "account__c")
let soupIndexForAddress_Line_2__c = SFSoupIndex(path: "Address_Line_2__c", indexType: "string", columnName: "Address_Line_2__c")
let soupIndexForCity__c = SFSoupIndex(path: "City__c", indexType: "string", columnName: "City__c")
let soupIndexForName = SFSoupIndex(path: "Name", indexType: "string", columnName: "Name")
let soupIndexForPhone__c = SFSoupIndex(path: "Phone__c", indexType: "string", columnName: "Phone__c")
let soupIndexForPostal_Code__c = SFSoupIndex(path: "Postal_Code__c", indexType: "string", columnName: "Postal_Code__c")
let soupIndexForIsPersonAccount = SFSoupIndex(path: "IsPersonAccount", indexType: "string", columnName: "IsPersonAccount")
let indecesArray:NSArray = NSArray(objects: soupIndexForAccount__c,soupIndexForAddress_Line_2__c,soupIndexForCity__c,soupIndexForName,soupIndexForPhone__c,soupIndexForPostal_Code__c,soupIndexForIsPersonAccount)
let registeredOrNot = self.store.registerSoup("Address", withIndexSpecs: indecesArray as [AnyObject])
print(registeredOrNot)
exists = self.store.soupExists("Address")
print(exists)
let tempToCheck = self.store.allSoupNames()
let toSee = self.store.indicesForSoup("Address")
exists
有价值true
。这意味着我们可以理解有Address
汤存在。当我试图检索时,我allSoupNames()
发现nil
. 如果没有错误,变量必须具有我们插入的索引的值。但它正在显示。tempToCheck
toSee
nil
请帮我找出错误