ios error when trying to add photo
See original GitHub issue- running complete ios project.
- Adding messages no problem
- When trying to add a photo, app bombs with following error
2016-05-20 14:37:10.156 FriendlyChatSwift[32573:72997859] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UITableView.m:1716 2016-05-20 14:37:10.162 FriendlyChatSwift[32573:72997859] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (7), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).' *** First throw call stack: ( 0 CoreFoundation 0x0000000108852d85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010a9bddeb objc_exception_throw + 48 2 CoreFoundation 0x0000000108852bea +[NSException raise:format:arguments:] + 106 3 Foundation 0x0000000108ca3d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 4 UIKit 0x00000001095394ca -[UITableView _endCellAnimationsWithContext:] + 15146 5 UIKit 0x000000010954fcf0 -[UITableView _updateRowsAtIndexPaths:updateAction:withRowAnimation:] + 303 6 FriendlyChatSwift 0x0000000105a13f16 _TFFC17FriendlyChatSwift16FCViewController14viewWillAppearFSbT_U_FCSo15FIRDataSnapshotT_ + 774 7 FriendlyChatSwift 0x0000000105adf419 __63-[FIRDatabaseQuery observeEventType:withBlock:withCancelBlock:]_block_invoke + 37 8 FriendlyChatSwift 0x0000000105b064bc __43-[FChildEventRegistration fireEvent:queue:]_block_invoke64 + 88 9 libdispatch.dylib 0x000000010b467d9d _dispatch_call_block_and_release + 12 10 libdispatch.dylib 0x000000010b4883eb _dispatch_client_callout + 8 11 libdispatch.dylib 0x000000010b4701ef _dispatch_main_queue_callback_4CF + 1738 12 CoreFoundation 0x00000001087ac0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 13 CoreFoundation 0x000000010876db99 __CFRunLoopRun + 2073 14 CoreFoundation 0x000000010876d0f8 CFRunLoopRunSpecific + 488 15 GraphicsServices 0x000000010c8bcad2 GSEventRunModal + 161 16 UIKit 0x0000000109409f09 UIApplicationMain + 171 17 FriendlyChatSwift 0x0000000105a1974d main + 125 18 libdyld.dylib 0x000000010b4bc92d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (3 by maintainers)
Top GitHub Comments
missing
self.clientTable.reloadData()
afterself.messages.removeAll()
@JosephGarcia by moving the code from
viewDidAppear()
toviewDidLoad()
, you will remove the Realtime Database from the app whenever a user open the Camera Picker. The database listener is removed withinviewWillDisappear()
.