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
間違いを見つけるのを手伝ってください