Я получаю ошибку LLDB всякий раз, когда нажимаю на конкретную вкладку. Вкладка называется учетной записью и, как предполагается, вытащить данные из детского узла, называемого «запросами» и отображать эти данные в списке (контроллер представления таблицы). < /P>
Я делал это несколько раз раньше. Я даже использую свой собственный переработанный код для этой задачи, но ошибка продолжает появляться. Я уже удостоверился, что каждая кнопка/метка подключена к контроллеру представления, и я позаботился о том, чтобы никто не был отключен. Что еще это может быть?jabmix-162f2
│
├─ requests
│ ├─ -KyHPn3NA8gf3ZjmNOuB
│ │ ├─ from: "cKpCimS7nWSWYjyhulxBy0oDZup2"
│ │ ├─ location: "f"
│ │ ├─ message: "F"
│ │ ├─ name: "f"
│ │ ├─ to: "6c7dc014-46f9-41dc-a6fb-6f8f4e9650a6"
│ │ ├─ when: "f"
│ │ └─ whereField: "f"
Запрашивает объект
import Foundation
import Firebase
classrequests: NSObject {
//MARK : VARIABLES
var from: String?
var location: String?
var message: String?
var name: String?
var to: String?
var when: String?
var whereField: String?
var id: String?
}
< /code>
Вот метод, который я использую. ошибка возникает только тогда, когда я называю эту функцию. Кстати, requestSarray - это массив запросов, объявленных как таковые: var requestSarray = [requests] ()
исходный скриншот
//MARK : OBSERVE REQUESTS
func observeRequests(){
let ref = Database.database().reference().child("requests")
let userID = Auth.auth().currentUser?.uid
ref.observe(.childAdded, with: { (snapshot) in
if let dictionary = snapshot.value as? [String: AnyObject]{
let getRequest = requests()
getRequest.id = snapshot.key
getRequest.setValuesForKeys(dictionary)
//If its meant for that user, add it to the array.
if getRequest.to == userID {
self.requestsArray.insert(getRequest, at: 0)
}
//Reload the tableview
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
}, withCancel: nil)
}
Вот остальная часть кода из этого контроллера представления:
исходный скриншот
//MARK : TABLE VIEW FUNCTIONS
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return requestsArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = self.tableView.dequeueReusableCell(withIdentifier: "notificationCell") as! NotificationTableViewCell
let thisUsersRequest = requestsArray[indexPath.row]
//Lets the user know who they've received a notification from.
cell.receivedNotificationLabel.text = "You've received a notification from: \(thisUsersRequest.from!)"
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
sendRequest = requestsArray[indexPath.row]
performSegue(withIdentifier: "viewNotification", sender: self)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "viewNotification"){
let destination = segue.destination as! ViewNotificationController
destination.viewRequest = sendRequest
}
}
edit
исходный скриншот
6 jabMix1 0x00000001047130d0 -[FIRASessionReporter initwithPersistedConfig:] + 284
7 jabMix1 0x00000001046fedb8 __48-[FIRAMeasurement startMeasurementOnWorkerQueue]_block_invoke + 1828
8 libdispatch.dylib 0x0000000105c4145c _dispatch_client_callout + 16
9 libdispatch.dylib 0x0000000104e3c3fc _dispatch_once_f + 120
10 jabMix1 0x00000001046fe678 -[FIRAMeasurement startMeasurementOnWorkerQueue] + 268
11 jabMix1 0x00000001046fe444 -[FIRAMeasurement setEnabledOnWorkerQueue:] + 124
12 jabMix1 0x0000000104712d48 __52-[FIRAScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
13 libdispatch.dylib 0x0000000105c4149c _dispatch_call_block_and_release + 24
14 libdispatch.dylib 0x0000000105c4145c _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000105c50110 _dispatch_queue_serial_drain + 692
16 libdispatch.dylib 0x0000000105c449a4 _dispatch_queue_invoke + 332
17 libdispatch.dylib 0x0000000105c51104 _dispatch_root_queue_drain_deffered_wlh + 424
18 libdispatch.dylib 0x0000000105c58100 _dispatch_workloop_worker_thread + 652
19 libsystem_pthread.dylib 0x00000001816a2c20 _pthread_wqthread + 932
20 libsystem_pthread.dylib 0x00000001816a2c20 start_wqthread + 4
2017-11-07 00:12:18.280916-0500 jabMix1[422:77353] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-11-07 00:12:18.281 jabMix1[422] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-11-07 00:12:18.402982-0500 jabMix1[422:77280] refreshPreferences: HangTracerEnabled: 0
2017-11-07 00:12:18.403058-0500 jabMix1[422:77280] refreshPreferences: HangTracerDuration: 500
2017-11-07 00:12:18.403083-0500 jabMix1[422:77280] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
2017-11-07 00:12:18.457740-0500 jabMix1[422:77351] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-11-07 00:12:18.457 jabMix1[422] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-11-07 00:12:18.508750-0500 jabMix1[422:77353] TIC Read Status [1:0x0]: 1:57
2017-11-07 00:12:18.508776-0500 jabMix1[422:77353] TIC Read Status [1:0x0]: 1:57
2017-11-07 00:12:37.144501-0500 jabMix1[422:77280] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key -
KyJHTqHMY38GiJTc416.'
*** First throw call stack:
(0x181a79d04 0x180cc8528 0x181a799cc 0x182386780 0x182422c0c 0x1046b31c4 0x10469c17c 0x10479dc44 0x105c4149c 0x105c4145c 0x105c46050 0x181a21eb0 0x181a1fa8c 0x18193ffb8 0x1837d7f84 0x18af142f4 0x104699248 0x18146256c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Подробнее здесь: https://stackoverflow.com/questions/471 ... -coding-co
Приложение прекращено из-за исключения Uncaught: «Этот класс не является ключевым значением, совместимым с ключом» с Fir ⇐ IOS
Программируем под IOS
1759624830
Anonymous
Я получаю ошибку LLDB всякий раз, когда нажимаю на конкретную вкладку. Вкладка называется учетной записью и, как предполагается, вытащить данные из детского узла, называемого «запросами» и отображать эти данные в списке (контроллер представления таблицы). < /P>
Я делал это несколько раз раньше. Я даже использую свой собственный переработанный код для этой задачи, но ошибка продолжает появляться. Я уже удостоверился, что каждая кнопка/метка подключена к контроллеру представления, и я позаботился о том, чтобы никто не был отключен. [b] Что еще это может быть?jabmix-162f2
│
├─ requests
│ ├─ -KyHPn3NA8gf3ZjmNOuB
│ │ ├─ from: "cKpCimS7nWSWYjyhulxBy0oDZup2"
│ │ ├─ location: "f"
│ │ ├─ message: "F"
│ │ ├─ name: "f"
│ │ ├─ to: "6c7dc014-46f9-41dc-a6fb-6f8f4e9650a6"
│ │ ├─ when: "f"
│ │ └─ whereField: "f"
Запрашивает объект
import Foundation
import Firebase
classrequests: NSObject {
//MARK : VARIABLES
var from: String?
var location: String?
var message: String?
var name: String?
var to: String?
var when: String?
var whereField: String?
var id: String?
}
< /code>
Вот метод, который я использую. ошибка возникает только тогда, когда я называю эту функцию. Кстати, requestSarray - это массив запросов, объявленных как таковые: var requestSarray = [requests] ()
исходный скриншот
//MARK : OBSERVE REQUESTS
func observeRequests(){
let ref = Database.database().reference().child("requests")
let userID = Auth.auth().currentUser?.uid
ref.observe(.childAdded, with: { (snapshot) in
if let dictionary = snapshot.value as? [String: AnyObject]{
let getRequest = requests()
getRequest.id = snapshot.key
getRequest.setValuesForKeys(dictionary)
//If its meant for that user, add it to the array.
if getRequest.to == userID {
self.requestsArray.insert(getRequest, at: 0)
}
//Reload the tableview
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
}, withCancel: nil)
}
Вот остальная часть кода из этого контроллера представления:
исходный скриншот
//MARK : TABLE VIEW FUNCTIONS
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return requestsArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = self.tableView.dequeueReusableCell(withIdentifier: "notificationCell") as! NotificationTableViewCell
let thisUsersRequest = requestsArray[indexPath.row]
//Lets the user know who they've received a notification from.
cell.receivedNotificationLabel.text = "You've received a notification from: \(thisUsersRequest.from!)"
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
sendRequest = requestsArray[indexPath.row]
performSegue(withIdentifier: "viewNotification", sender: self)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "viewNotification"){
let destination = segue.destination as! ViewNotificationController
destination.viewRequest = sendRequest
}
}
edit [/b]
исходный скриншот
6 jabMix1 0x00000001047130d0 -[FIRASessionReporter initwithPersistedConfig:] + 284
7 jabMix1 0x00000001046fedb8 __48-[FIRAMeasurement startMeasurementOnWorkerQueue]_block_invoke + 1828
8 libdispatch.dylib 0x0000000105c4145c _dispatch_client_callout + 16
9 libdispatch.dylib 0x0000000104e3c3fc _dispatch_once_f + 120
10 jabMix1 0x00000001046fe678 -[FIRAMeasurement startMeasurementOnWorkerQueue] + 268
11 jabMix1 0x00000001046fe444 -[FIRAMeasurement setEnabledOnWorkerQueue:] + 124
12 jabMix1 0x0000000104712d48 __52-[FIRAScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
13 libdispatch.dylib 0x0000000105c4149c _dispatch_call_block_and_release + 24
14 libdispatch.dylib 0x0000000105c4145c _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000105c50110 _dispatch_queue_serial_drain + 692
16 libdispatch.dylib 0x0000000105c449a4 _dispatch_queue_invoke + 332
17 libdispatch.dylib 0x0000000105c51104 _dispatch_root_queue_drain_deffered_wlh + 424
18 libdispatch.dylib 0x0000000105c58100 _dispatch_workloop_worker_thread + 652
19 libsystem_pthread.dylib 0x00000001816a2c20 _pthread_wqthread + 932
20 libsystem_pthread.dylib 0x00000001816a2c20 start_wqthread + 4
2017-11-07 00:12:18.280916-0500 jabMix1[422:77353] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-11-07 00:12:18.281 jabMix1[422] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-11-07 00:12:18.402982-0500 jabMix1[422:77280] refreshPreferences: HangTracerEnabled: 0
2017-11-07 00:12:18.403058-0500 jabMix1[422:77280] refreshPreferences: HangTracerDuration: 500
2017-11-07 00:12:18.403083-0500 jabMix1[422:77280] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
2017-11-07 00:12:18.457740-0500 jabMix1[422:77351] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-11-07 00:12:18.457 jabMix1[422] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-11-07 00:12:18.508750-0500 jabMix1[422:77353] TIC Read Status [1:0x0]: 1:57
2017-11-07 00:12:18.508776-0500 jabMix1[422:77353] TIC Read Status [1:0x0]: 1:57
2017-11-07 00:12:37.144501-0500 jabMix1[422:77280] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key -
KyJHTqHMY38GiJTc416.'
*** First throw call stack:
(0x181a79d04 0x180cc8528 0x181a799cc 0x182386780 0x182422c0c 0x1046b31c4 0x10469c17c 0x10479dc44 0x105c4149c 0x105c4145c 0x105c46050 0x181a21eb0 0x181a1fa8c 0x18193ffb8 0x1837d7f84 0x18af142f4 0x104699248 0x18146256c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Подробнее здесь: [url]https://stackoverflow.com/questions/47149903/app-terminated-due-to-uncaught-exception-this-class-is-not-key-value-coding-co[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия