Roobiq / RBQFetchedResultsController

Drop-in replacement for NSFetchedResultsController backed by Realm.
MIT License
477 stars 70 forks source link

Issue with new version notifications #88

Closed wieseljonas closed 8 years ago

wieseljonas commented 8 years ago

I upgraded realm and have an issue that I cannot disable notifications when deleting item and having removed the viewcontroller.

I get the following error. thanks for you help

2016-04-28 11:39:02.914 Mako[45913:456740] *** Terminating app due to uncaught exception 'RLMException', reason: 'Index 9223372036854775808 is out of bounds (must be less than 15)'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010f910d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000110fdcdeb objc_exception_throw + 48
    2   Realm                               0x000000010d0f9ca0 _ZL10throwErrorv + 464
    3   Realm                               0x000000010d0f5baa _ZL15translateErrorsIZ34-[RLMArrayLinkView objectAtIndex:]E3$_3EDaOT_ + 58
    4   Realm                               0x000000010d0f5b52 -[RLMArrayLinkView objectAtIndex:] + 82
    5   RBQFetchedResultsController         0x000000010cfc78cc -[RBQFetchedResultsController safeObjectsFromChanges:withCollection:isInsertion:] + 972
    6   RBQFetchedResultsController         0x000000010cfc8744 __58-[RBQFetchedResultsController registerChangeNotifications]_block_invoke_2.385 + 324
    7   Realm                               0x000000010d10338c _ZZ23RLMAddNotificationBlockIN5realm7ResultsEEP20RLMNotificationTokenP11objc_objectRT_U13block_pointerFvS5_P19RLMCollectionChangeP7NSErrorEbENUlRKNS0_19CollectionChangeSetESt13exception_ptrE_clESG_SH_ + 620
    8   Realm                               0x000000010d1030e9 _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZ23RLMAddNotificationBlockIN5realm7ResultsEEP20RLMNotificationTokenP11objc_objectRT_U13block_pointerFvS9_P19RLMCollectionChangeP7NSErrorEbEUlRKNS4_19CollectionChangeSetESt13exception_ptrE_SI_SL_EEEvDpOT_ + 153
    9   Realm                               0x000000010d102e89 _ZNSt3__110__function6__funcIZ23RLMAddNotificationBlockIN5realm7ResultsEEP20RLMNotificationTokenP11objc_objectRT_U13block_pointerFvS8_P19RLMCollectionChangeP7NSErrorEbEUlRKNS3_19CollectionChangeSetESt13exception_ptrE_NS_9allocatorISL_EEFvSH_SK_EEclEOSH_OSK_ + 73
    10  Realm                               0x000000010d05169c _ZNKSt3__18functionIFvN5realm19CollectionChangeSetESt13exception_ptrEEclES2_S3_ + 172
    11  Realm                               0x000000010d04fb96 _ZN5realm5_impl18CollectionNotifier14call_callbacksEv + 198
    12  Realm                               0x000000010d0aba87 _ZN5realm5_impl16RealmCoordinator16advance_to_readyERNS_5RealmE + 3079
    13  Realm                               0x000000010d24bdc9 _ZN5realm5Realm6notifyEv + 329
    14  Realm                               0x000000010d27429f _ZZN5realm5_impl17WeakRealmNotifierC1ERKNSt3__110shared_ptrINS_5RealmEEEbENK3$_0clEPv + 79
    15  Realm                               0x000000010d274248 _ZZN5realm5_impl17WeakRealmNotifierC1ERKNSt3__110shared_ptrINS_5RealmEEEbEN3$_08__invokeEPv + 24
    16  CoreFoundation                      0x000000010f836301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    17  CoreFoundation                      0x000000010f82c22c __CFRunLoopDoSources0 + 556
    18  CoreFoundation                      0x000000010f82b6e3 __CFRunLoopRun + 867
    19  CoreFoundation                      0x000000010f82b0f8 CFRunLoopRunSpecific + 488
    20  CoreFoundation                      0x000000010f8e2501 CFRunLoopRun + 97
    21  RBQFetchedResultsController         0x000000010cfc7fe1 __58-[RBQFetchedResultsController registerChangeNotifications]_block_invoke + 193
    22  libdispatch.dylib                   0x0000000111a9fd9d _dispatch_call_block_and_release + 12
    23  libdispatch.dylib                   0x0000000111ac03eb _dispatch_client_callout + 8
    24  libdispatch.dylib                   0x0000000111aa8b2f _dispatch_root_queue_drain + 1829
    25  libdispatch.dylib                   0x0000000111aa8405 _dispatch_worker_thread3 + 111
    26  libsystem_pthread.dylib             0x0000000111e144de _pthread_wqthread + 1129
    27  libsystem_pthread.dylib             0x0000000111e12341 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
wieseljonas commented 8 years ago

86 seems to be the same error sorry for double post

bigfish24 commented 8 years ago

No problem going to fix today!

bigfish24 commented 8 years ago

Fixed in: https://github.com/Roobiq/RBQFetchedResultsController/releases/tag/v4.0.3

bigfish24 commented 8 years ago

Note that you should only use RBQFRC if you want the section capabilities. If you don't need this, just use Realm's fine-grained notifications directly: https://realm.io/news/realm-objc-swift-0.99.0/