function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vladimir BessonovVladimir Bessonov 

ios sdk query

I am using code from iOS13Native. 
when Use Apex and do the same query I receive workspaces from office (office - workspace are parent - detail) 

but the same code iOS SDK does not return any workspaces. 

let request = RestClient.shared.request(forQuery: "SELECT id, Name, WorkSpaceID__c FROM WorkSpace__c WHERE Office__c = '\(offi.id)'", apiVersion: nil)
the code I used is copy-paste from  ContactsForAccount in this example.

I can get offices like Accounts, but when I try to get workspaces I receive nothing and no error.

// import Foundation import SalesforceSDKCore import Combine struct WorkSpace : Hashable, Identifiable, Decodable { let id: String let Name: String? let Office: String? } struct WorkSpaceResponse: Decodable { var totalSize: Int var done: Bool var records: [WorkSpace] } class WorkSpaceForOfficeModel: ObservableObject { @Published var workspaces: [WorkSpace] = [] var office: Office? private var workspacesCancellable: AnyCancellable? func fetchWorkSpacesForOffice(){ guard let offi = self.office else {return} print("office id in query \(offi.id)") let request = RestClient.shared.request(forQuery: "SELECT id, Name, WorkSpaceID__c FROM WorkSpace__c WHERE Office__c = '\(offi.id)'", apiVersion: nil) workspacesCancellable = RestClient.shared.publisher(for: request) .receive(on: RunLoop.main) .tryMap({ (response) -> Data in print("mapping data") return response.asData() }) .decode(type: WorkSpaceResponse.self, decoder: JSONDecoder()) .map({ (record) -> [WorkSpace] in record.records }) .catch( { error in Just([]) }) .assign(to: \.workspaces, on:self) } }
After some time in console I see 
Received memory pressure event 2 vm pressure 0 2020-10-07 17:25:35.477711-0700 iOS13NativeSwiftTemplate[27097:10283468] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service 2020-10-07 17:25:35.481420-0700 iOS13NativeSwiftTemplate[27097:10283468] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
How it is supposed to work? 

Async call 
self.viewModel.fetchWorkSpacesForOffice()
then when @ObservedObject is changed UI shall be updated? 
@ObservedObject var viewModel = WorkSpaceForOfficeModel()
My usersyncs is below
as I understand from Docu if workspace is detail of Office (line contact is detail of Account in template ) I dont need to create soup for workspaces. I can get them with sql query to offline data. Is it? 
{ "syncs": [ { "syncName": "syncDownAccounts", "syncType": "syncDown", "soupName": "Account", "target": {"type": "soql", "query":"SELECT Id, Name, Industry FROM Account LIMIT 25"}, "options": {"fieldlist":["Id", "Name", "Industry", "LastModifiedDate"], "mergeMode":"LEAVE_IF_CHANGED"} }, { "syncName": "syncDownOffices", "syncType": "syncDown", "soupName": "Office", "target": {"type": "soql", "query":"SELECT Id, OfficeID__c, GPS__c, Name FROM Office__c LIMIT 20"}, "options": {"fieldlist":[ "OfficeID__c","GPS__c", "Name", "LastModifiedDate"], "mergeMode":"LEAVE_IF_CHANGED"} } ] }