Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.40 KB | None | 0 0
  1. Thread 1: signal SIGABRT
  2.  
  3. import UIKit
  4.  
  5. class User: NSObject {
  6.  
  7. @objc var name: String?
  8. @objc var code: String?
  9. @objc var accountType: String?
  10. var timestamp: TimeInterval?
  11.  
  12. }
  13.  
  14. ref = Database.database().reference().child("users")
  15.  
  16. let key = ref?.childByAutoId().key
  17.  
  18. let date = Date()
  19. let timestamp = date.timeIntervalSince1970
  20.  
  21. let dataSaved : [String:Any] = ["name":nameTxt.text! as String, "code":codeTxt.text! as String, "accountType":accountType as String,"timestamp":timestamp as TimeInterval]
  22. ref?.child(key!).setValue(dataSaved)
  23.  
  24. @objc func fetchUsers(){
  25.  
  26. // snapshot
  27.  
  28. handle = ref?.child("users").observe(.childAdded, with: { (snapshot) in
  29. if let dictionary = snapshot.value as? [String : AnyObject]{
  30.  
  31. print(dictionary)
  32.  
  33. let user = User()
  34. user.setValuesForKeys(dictionary)
  35. self.myList.append(user)
  36.  
  37.  
  38. DispatchQueue.main.async {
  39. self.myTableview.reloadData()
  40. }
  41.  
  42. }
  43. })
  44.  
  45.  
  46.  
  47. }
  48.  
  49. 2018-01-21 19:44:19.741130+0300 AddMe Social[14827:522721] [MC] Lazy loading NSBundle MobileCoreServices.framework
  50. 2018-01-21 19:44:19.743342+0300 AddMe Social[14827:522721] [MC] Loaded MobileCoreServices.framework
  51. 2018-01-21 19:44:19.753564+0300 AddMe Social[14827:522721] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/Maher/Library/Developer/CoreSimulator/Devices/144580E8-06C1-490F-BD08-CBA0F1994EBB/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
  52. 2018-01-21 19:44:19.799641+0300 AddMe Social[14827:522957] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40002000 started
  53. 2018-01-21 19:44:19.800 AddMe Social[14827] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40002000 started
  54. 2018-01-21 19:44:19.801215+0300 AddMe Social[14827:522957] [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled ()
  55. 2018-01-21 19:44:19.808 AddMe Social[14827] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled ()
  56. 2018-01-21 19:44:19.920472+0300 AddMe Social[14827:522721] [MC] Reading from private effective user settings.
  57. 2018-01-21 19:44:19.926419+0300 AddMe Social[14827:522976] Could not successfully update network info during initialization.
  58. 2018-01-21 19:44:20.067907+0300 AddMe Social[14827:522966] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length
  59. 2018-01-21 19:44:20.188815+0300 AddMe Social[14827:522957] [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
  60. 2018-01-21 19:44:20.190 AddMe Social[14827] <Notice> [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
  61. 2018-01-21 19:44:20.514132+0300 AddMe Social[14827:522957] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
  62. 2018-01-21 19:44:20.514 AddMe Social[14827] <Warning> [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
  63. 2018-01-21 19:44:20.517536+0300 AddMe Social[14827:522976] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
  64. 2018-01-21 19:44:20.517 AddMe Social[14827] <Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
  65. 2018-01-21 19:44:20.523193+0300 AddMe Social[14827:522954] TIC Read Status [1:0x0]: 1:57
  66. 2018-01-21 19:44:20.523372+0300 AddMe Social[14827:522954] TIC Read Status [1:0x0]: 1:57
  67. ["name": fdgf, "timestamp": 1516545687.582723, "code": dfgd, "accountType": Twitter]
  68. 2018-01-21 19:44:23.041444+0300 AddMe Social[14827:522721] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<AddMe_Social.User 0x6040000e7780> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key timestamp.'
  69. *** First throw call stack:
  70. (
  71. 0 CoreFoundation 0x000000010c8511cb __exceptionPreprocess + 171
  72. 1 libobjc.A.dylib 0x000000010ad90f41 objc_exception_throw + 48
  73. 2 CoreFoundation 0x000000010c851119 -[NSException raise] + 9
  74. 3 Foundation 0x000000010a7b31e3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
  75. 4 Foundation 0x000000010a811ed2 -[NSObject(NSKeyValueCoding) setValuesForKeysWithDictionary:] + 283
  76. 5 AddMe Social 0x00000001091514ed _T012AddMe_Social10MainScreenC10fetchUsersyyFySo12DataSnapshotCcfU_ + 1037
  77. 6 AddMe Social 0x000000010915181a _T012AddMe_Social10MainScreenC10fetchUsersyyFySo12DataSnapshotCcfU_TA + 58
  78. 7 AddMe Social 0x000000010915191e _T0So12DataSnapshotCIxx_ABIyBy_TR + 62
  79. 8 AddMe Social 0x00000001091ddad9 __63-[FIRDatabaseQuery observeEventType:withBlock:withCancelBlock:]_block_invoke + 37
  80. 9 AddMe Social 0x000000010920a7fd __43-[FChildEventRegistration fireEvent:queue:]_block_invoke.55 + 88
  81. 10 libdispatch.dylib 0x00000001114ef3f7 _dispatch_call_block_and_release + 12
  82. 11 libdispatch.dylib 0x00000001114f043c _dispatch_client_callout + 8
  83. 12 libdispatch.dylib 0x00000001114fb6f0 _dispatch_main_queue_callback_4CF + 628
  84. 13 CoreFoundation 0x000000010c813ef9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
  85. 14 CoreFoundation 0x000000010c7d8662 __CFRunLoopRun + 2402
  86. 15 CoreFoundation 0x000000010c7d7a89 CFRunLoopRunSpecific + 409
  87. 16 GraphicsServices 0x0000000113b3f9c6 GSEventRunModal + 62
  88. 17 UIKit 0x000000010e73f23c UIApplicationMain + 159
  89. 18 AddMe Social 0x000000010915dd77 main + 55
  90. 19 libdyld.dylib 0x000000011156cd81 start + 1
  91. 20 ??? 0x0000000000000001 0x0 + 1
  92. )
  93. libc++abi.dylib: terminating with uncaught exception of type NSException
  94. (lldb)
Add Comment
Please, Sign In to add comment