Comments (8)
Could this be related to #49 ?
from rbqfetchedresultscontroller.
[;2016-03-15 18:18:50.944 App[325:60047] *** Assertion failure in -[CYChatCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /SourceCache/UIKit/UIKit-3347.44.2.2/UICollectionView.m:4072
(lldb) bt
* thread #1: tid = 0xea8f, 0x0000000196fc80a8 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000196fc80a8 libobjc.A.dylib`objc_exception_throw
frame #1: 0x00000001852fc0ec CoreFoundation`+[NSException raise:format:arguments:] + 116
frame #2: 0x00000001861b0ed4 Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
frame #3: 0x000000018a405a14 UIKit`-[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:] + 9932
frame #4: 0x000000018a408828 UIKit`-[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 352
* frame #5: 0x00000001004e6198 App`-[UICollectionView(self=0x000000012f111000, _cmd="commitChangesWithCompletion:", completion=(CashYT`__74-[AppFetchedResultsControllerDelegator controllerDidChangeContent:]_block_invoke at CYChatViewFetchedResultsControllerDelegator.m:67)) commitChangesWithCompletion:] + 1308 at UICollectionView+NSFetchedResultsController.m:136
frame #6: 0x000000010016bf94 App`-[AppFetchedResultsControllerDelegator controllerDidChangeContent:](self=0x0000000170234e40, _cmd="controllerDidChangeContent:", controller=0x00000001708702c0) + 292 at CYChatViewFetchedResultsControllerDelegator.m:67
frame #7: 0x00000001004f0bc8 App`__112-[RBQFetchedResultsController calculateChangesWithAddedSafeObjects:deletedSafeObjects:changedSafeObjects:realm:]_block_invoke418(.block_descriptor=<unavailable>) + 248 at RBQFetchedResultsController.m:753
frame #8: 0x000000010164cfd4 libdispatch.dylib`_dispatch_call_block_and_release + 24
frame #9: 0x000000010164cf94 libdispatch.dylib`_dispatch_client_callout + 16
frame #10: 0x0000000101651c28 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1864
frame #11: 0x00000001852b3544 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
frame #12: 0x00000001852b15ec CoreFoundation`__CFRunLoopRun + 1492
frame #13: 0x00000001851dcf74 CoreFoundation`CFRunLoopRunSpecific + 396
frame #14: 0x000000018ec376fc GraphicsServices`GSEventRunModal + 168
frame #15: 0x0000000189dded94 UIKit`UIApplicationMain + 1488
frame #16: 0x00000001001bd420 App`main(argc=1, argv=0x000000016fd6f968) + 856 at main.m:41
frame #17: 0x0000000197672a08 libdyld.dylib`start + 4
2016-03-15 18:19:40.483 App[325:60047] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (81) must be equal to the number of items contained in that section before the update (80), plus or minus the number of items inserted or deleted from that section (38 inserted, 32 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'
Here is another crash log. it says that 32 items were deleted, while in fact only 1 was added.
from rbqfetchedresultscontroller.
@tiagoveloso that is really bizarre. I don't think it is related to #49
Can you verify all the areas that are creating a Realm transaction and calling the various notification methods for RBQRealmNotificationManager
such as addObjectWithNotification:
What you can do too to debug is add your own debug block to RBQRealmNotificationManager
:
[[RBQRealmNotificationManager defaultManager] addNotificationBlock:^(NSDictionary *entityChanges, RLMRealm *realm) {
// You can inspect the entityChanges dictionary
// The key is a string of the Realm object classname
// The object is an instance of RBQEntityChangesObject
RBQEntityChangesObject *objectChanges = entityChanges[@"CLASSNAME"];
NSLog(@"Added Objects: %d", objectChanges.addedSafeObjects.count);
NSLog(@"Deleted Objects: %d", objectChanges.deletedSafeObjects.count);
NSLog(@"Changed Objects: %d", objectChanges.changedSafeObjects.count);
}];
If those counts are higher than 1 then your code is calling more notifications than necessary, but if not then there is a bug in RBQFRC.
from rbqfetchedresultscontroller.
This is weird, the notification block sees 1 added objects.
The debug log inside RBQFRC says there is 1 derived added objects.
The collection view says there are 2 added objects.
2016-03-16 12:37:52.006 App[553:308024] Added Objects: 1
2016-03-16 12:37:52.006 App[553:308024] Deleted Objects: 0
2016-03-16 12:37:52.006 App[553:308024] Changed Objects: 0
2016-03-16 12:37:52.029 App[553:308024] 0 Derived Inserted Sections
2016-03-16 12:37:52.029 App[553:308024] 0 Derived Deleted Sections
2016-03-16 12:37:52.029 App[553:308024] 1 Derived Added Objects
2016-03-16 12:37:52.029 App[553:308024] 0 Derived Deleted Objects
2016-03-16 12:37:52.030 App[553:308024] 0 Derived Moved Objects
2016-03-16 12:37:52.169 CashYT[553:307234] *** Assertion failure in -[CYChatCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering: /SourceCache/UIKit/UIKit-3347.44.2.2/UICollectionView.m:4072
(lldb) bt
* thread #1: tid = 0x4b022, 0x0000000196fc80a8 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000196fc80a8 libobjc.A.dylib`objc_exception_throw
frame #1: 0x00000001852fc0ec CoreFoundation`+[NSException raise:format:arguments:] + 116
frame #2: 0x00000001861b0ed4 Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
frame #3: 0x000000018a405a14 UIKit`-[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:] + 9932
frame #4: 0x000000018a408828 UIKit`-[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 352
* frame #5: 0x00000001004739b8 App`-[UICollectionView(self=0x000000014f0e7e00, _cmd="commitChangesWithCompletion:", completion=(CashYT`__74-[AppFetchedResultsControllerDelegator controllerDidChangeContent:]_block_invoke at CYChatViewFetchedResultsControllerDelegator.m:67)) commitChangesWithCompletion:] + 1308 at UICollectionView+NSFetchedResultsController.m:136
frame #6: 0x0000000100100b8c App`-[AppFetchedResultsControllerDelegator controllerDidChangeContent:](self=0x0000000174629a60, _cmd="controllerDidChangeContent:", controller=0x0000000175876780) + 292 at CYChatViewFetchedResultsControllerDelegator.m:67
frame #7: 0x000000010047e3e8 App`__112-[RBQFetchedResultsController calculateChangesWithAddedSafeObjects:deletedSafeObjects:changedSafeObjects:realm:]_block_invoke418(.block_descriptor=<unavailable>) + 248 at RBQFetchedResultsController.m:753
frame #8: 0x00000001015ccfd4 libdispatch.dylib`_dispatch_call_block_and_release + 24
frame #9: 0x00000001015ccf94 libdispatch.dylib`_dispatch_client_callout + 16
frame #10: 0x00000001015d1c28 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1864
frame #11: 0x00000001852b3544 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
frame #12: 0x00000001852b15ec CoreFoundation`__CFRunLoopRun + 1492
frame #13: 0x00000001851dcf74 CoreFoundation`CFRunLoopRunSpecific + 396
frame #14: 0x000000018ec376fc GraphicsServices`GSEventRunModal + 168
frame #15: 0x0000000189dded94 UIKit`UIApplicationMain + 1488
frame #16: 0x0000000100152018 App`main(argc=1, argv=0x000000016fddb968) + 856 at main.m:41
frame #17: 0x0000000197672a08 libdyld.dylib`start + 4
2016-03-16 12:38:21.013 App[553:307234] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (659) must be equal to the number of items contained in that section before the update (658), plus or minus the number of items inserted or deleted from that section (2 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'
*** First throw call stack:
(0x1852fc22c 0x196fc80e4 0x1852fc0ec 0x1861b0ed4 0x18a405a14 0x18a408828 0x1004739b8 0x100100b8c 0x10047e3e8 0x1015ccfd4 0x1015ccf94 0x1015d1c28 0x1852b3544 0x1852b15ec 0x1851dcf74 0x18ec376fc 0x189dded94 0x100152018 0x197672a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
from rbqfetchedresultscontroller.
@tiagoveloso can you provide the code that implements the RBQFRC delegate?
from rbqfetchedresultscontroller.
@bigfish24 Can I send you the sample code outside Github? Is it ok if I send you a snippet to your realm email?
from rbqfetchedresultscontroller.
@tiagoveloso feel free to email me at [email protected]
from rbqfetchedresultscontroller.
Did you find the solution for this issue?
from rbqfetchedresultscontroller.
Related Issues (20)
- Support transient properties for sectionNameKeyPath HOT 4
- Don't release delegate HOT 5
- Crash on `performFetch` - Index is out of bounds
- Ability to turn off excessive logging for debug builds HOT 3
- When init with a empty realm, the `notificationCollection`'s `notificationBlock` might never got call
- Dead lock when FRC -updateFetchRequest in main thread and -calculateChangesWithAddedSafeObjects in background within same time;
- RBQFetchedRequest support for Properties to Group By
- Swift3 no notification passed to the delegate HOT 1
- RealmSwift 2.1.1 HOT 1
- Reintroduce Git Submodules for RBQSafeRealmObject and RealmUtilities HOT 1
- Crash when deleting sectioned objects.
- Constant crash. HOT 1
- Delegate never released HOT 7
- Update Realm dependency to 2.2
- Sorting with localizedCaseInsensitiveCompare
- SectionNameKeyPath cannot be transient? HOT 1
- Can't support Realm 3.0.0? HOT 6
- can not support Realm (3.7.4)
- Not working with swift 4
- Could you make unregisterChangeNotifications public
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbqfetchedresultscontroller.