Вот моя проблема: мое приложение извлекает записи из CloudKit отлично при подключении к Xcode на моем телефоне (с использованием схемы выпуска), но когда я выпуская его на TestFlight, t получить записи.CloudKit Query работает над выпуском Xcode, а не на TestFlight
Вот моя выборка функции:
func allprevFacts(date: String, olddate: Int){
act.startAnimating()
let container = CKContainer.defaultContainer()
let publicDB = container.publicCloudDatabase
//let factPredicate = NSPredicate(format: "recordID = %@", CKRecordID(recordName: date))
let factPredicate = NSPredicate(format: "date <= %@", NSDate())
let query = CKQuery(recordType: "BirdFacts", predicate: factPredicate)
publicDB.performQuery(query, inZoneWithID: nil) { (results, error) -> Void in
if error != nil {
print(error)
}
else {
dispatch_async(dispatch_get_main_queue()){
//print(results)
var count = 0
var sortedresults = [Int]()
for result in results! {
var b = result.valueForKey("sortingDate") as! Int
sortedresults.append(b)
}
print(sortedresults)
while count < sortedresults.count {
if sortedresults[count] <= olddate {
sortedresults.removeAtIndex(count)
}
else {
count = count + 1
}
}
print(sortedresults)
while sortedresults.count > 0 {
var d: Int = 0
let a = sortedresults[sortedresults.endIndex-1]
print(a)
while d < sortedresults.count{
if sortedresults[d] == a {
sortedresults.removeAtIndex(d)
self.birdFacts.append(results![d])
self.tableFacts.reloadData()
self.tableFacts.hidden = false
}
d = d + 1
print(d)
}
}
self.saveFacts()
print("saving bird facts")
self.tableFacts.hidden = false
}
}
}
act.stopAnimating()
}
Вот вывод iPhone консоль, когда я запустить приложение (и он должен выполнить запрос CloudKit):
Jun 8 09:15:06 Alexs-iPhone SpringBoard[63] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName] Jun 8 09:15:06 Alexs-iPhone SpringBoard[63] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName] Jun 8 09:15:06 Alexs-iPhone kernel[0] : xpcproxy[468] Container: /private/var/mobile/Containers/Data/Application/85885117-5626-4CC1-90B4-A7C14F5C9AE5 (sandbox) Jun 8 09:15:06 Alexs-iPhone com.apple.xpc.launchd[1] : assertion failed: 13F69: launchd + 116796 [9F6284CF-8A17-36CC-9DB5-85D510A21F14]: 0x3 Jun 8 09:15:07 Alexs-iPhone limitadtrackingd[463] : Lost connection from Limit Ad Tracking client. Jun 8 09:15:07 Alexs-iPhone limitadtrackingd[463] : Lost connection from Limit Ad Tracking client. Jun 8 09:15:08 Alexs-iPhone SpringBoard[63] : Application 'UIKitApplication:com.apple.AdSheetPhone[0x5386]' exited voluntarily. Jun 8 09:15:08 Alexs-iPhone UserEventAgent[26] : 94505698100: id=com.apple.AdSheetPhone pid=464, state=0 Jun 8 09:15:08 Alexs-iPhone cloudd[197] : no delegate for <__NSCFLocalDataTask: 0x103d617c0>{ taskIdentifier: 11 } { completed } (CKDQueryURLRequest requestUUID:22D6A501-9D0B-4388-8316-431100DA5BE3) in session <__NSURLSessionLocal: 0x1002ddd80> for call URLSession:task:didCompleteWithError: Jun 8 09:15:18 Alexs-iPhone assistantd[30] : tcp_connection_tls_session_error_callback_imp 13 __tcp_connection_tls_session_callback_write_block_invoke.434 error 22 Jun 8 09:15:18 Alexs-iPhone assistantd[30] : NSURLSessionStreamTask: TCPConnection read invalidated by closed connection Jun 8 09:15:18 Alexs-iPhone networkd[100] : -[NETAWDManager reportStats:metricID:] AWDServerConnection newMetricContainerWithIdentifier failed for metric 2686980, server 0x14562a930, not reporting: { "client_id" = assistantd; "establishment_cellular_fallback" = 0; "establishment_failure_error" = 0; "establishment_forced_tcp_fallback" = 0; "establishment_interface_name" = en0; "establishment_success" = 1; "establishment_syn_retransmits" = 0; "establishment_tcp_fallback" = 0; "establishment_time" = "0.05480975"; "interface_reports" = ( { "data_in_KB" = 0; "data_out_KB" = 0; "interface_name" = "pdp_ip0"; "post_connect_subflow_failure_errors" = ( ); "post_connect_tcp_fallback_count" = 0; "secondary_flow_failure_count" = 0; "secondary_flow_success_count" = 1; }, { "data_in_KB" = 5; "data_out_KB" = 2; "interface_name" = en0; "post_connect_subflow_failure_errors" = ( ); "post_connect_tcp_fallback_count" = 0; "secondary_flow_failure_count" = 0; "secondary_flow_success_count" = 0; } ); "post_connect_multi_homed" = 1; "post_connect_session_lifetime" = "42.576455291"; "post_connect_single_homed" = 0; "post_connect_subflow_attempt_count" = 2; "post_connect_subflow_max_subflow_count" = 2; "subflow_switching_count" = 0; } Jun 8 09:15:19 Alexs-iPhone SpringBoard[63] : [* error]: XPC Error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.coreduetd.knowledge was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.apple.coreduetd.knowledge was invalidated from this process.}
Я не могу сделать головы или хвосты кода ошибки, есть ли у кого-нибудь предложения о том, что может произойти неправильно?
Вы переместили свой контейнер в производство с панели управления облачным экраном? –
В этом была проблема! Спасибо!! – Alex
Я положил его в ответ ... –