仅在iOS 14中崩溃核心数据

仅在iOS 14中崩溃核心数据,ios,core-data,ios14,Ios,Core Data,Ios14,我在一个使用CoreData的应用程序上工作,在iOS 13和iOS 14上使用不同的Xcode Beta,一切都很好。但是自从苹果发布了iOS 14和Xcode 12的官方版本后,当我试图从CoreData获取一些对象时,我遇到了崩溃 guard let customers=Customer.mr_findAllSorted(by:“login”,升序:true)为?[客户]其他{return} 控制台输出: *** Terminating app due to uncaught except

我在一个使用CoreData的应用程序上工作,在iOS 13和iOS 14上使用不同的Xcode Beta,一切都很好。但是自从苹果发布了iOS 14和Xcode 12的官方版本后,当我试图从CoreData获取一些对象时,我遇到了崩溃

guard let customers=Customer.mr_findAllSorted(by:“login”,升序:true)为?[客户]其他{return}

控制台输出:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't get value for 'batch' in bindings {
}.'
当我尝试使用断点从控制台日志打印对象时,我有一个对象的内存地址,但当我尝试打印此对象的某些值时,我出现以下错误:

error: warning: couldn't get required object pointer (substituting NULL): Couldn't load 'self' because its value couldn't be evaluated

error: Execution was interrupted, reason: internal ObjC exception breakpoint(-5)..
The process has been returned to the state before expression evaluation.
自从官方版本发布以来,有没有人必须处理此类错误


提前感谢您的帮助。

我们在应用程序中也看到了这一点。它只适用于iOS 14和Xcode 12.0.1中的最新SDK,但我们还没有任何解决方案或答案来解释为什么会出现这种情况

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't get value for 'batch' in bindings {
}.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff2043a126 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff20177f78 objc_exception_throw + 48
    2   Foundation                          0x00007fff2088bedc -[NSVariableExpression _expressionWithSubstitutionVariables:] + 0
    3   Foundation                          0x00007fff2075ac7b -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 264
    4   CoreData                            0x00007fff2511ec68 -[NSDictionaryStoreMap handleFetchRequest:] + 481
    5   CoreData                            0x00007fff2511dfd2 -[NSMappedObjectStore executeFetchRequest:withContext:] + 230
    6   CoreData                            0x00007fff251e10a2 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.797 + 3219
    7   CoreData                            0x00007fff251d988d __55-[NSPersistentStoreCoordinator _routeHeavyweightBlock:]_block_invoke + 55
    8   CoreData                            0x00007fff251edf0a gutsOfBlockToNSPersistentStoreCoordinatorPerform + 182
    9   libdispatch.dylib                   0x000000010a6b0a88 _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x000000010a6bfcac _dispatch_lane_barrier_sync_invoke_and_complete + 132
    11  CoreData                            0x00007fff251d9492 _perform + 169
    12  CoreData                            0x00007fff251d9740 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 172
    13  CoreData                            0x00007fff250d640e -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1684
    14  CoreData                            0x00007fff250d49c2 -[NSManagedObjectContext executeFetchRequest:error:] + 885
    15  CoreData                            0x00007fff251a9d7f -[NSManagedObjectContext _parentObjectsForFetchRequest:inContext:error:] + 477
    16  CoreData                            0x00007fff251aa774 __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 603
    17  CoreData                            0x00007fff25109de8 internalBlockToNSManagedObjectContextPerform + 89
    18  libdispatch.dylib                   0x000000010a6b0a88 _dispatch_client_callout + 8
    19  libdispatch.dylib                   0x000000010a6bfcac _dispatch_lane_barrier_sync_invoke_and_complete + 132
    20  CoreData                            0x00007fff25109d6f _perform + 196
    21  CoreData                            0x00007fff25109b93 -[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:] + 175
    22  CoreData                            0x00007fff250d49c2 -[NSManagedObjectContext executeFetchRequest:error:] + 885
    23  CoreData                            0x00007fff251a9d7f -[NSManagedObjectContext _parentObjectsForFetchRequest:inContext:error:] + 477
    24  CoreData                            0x00007fff251aa774 __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 603
    25  CoreData                            0x00007fff25109de8 internalBlockToNSManagedObjectContextPerform + 89
    26  libdispatch.dylib                   0x000000010a6b0a88 _dispatch_client_callout + 8
    27  libdispatch.dylib                   0x000000010a6bfe11 _dispatch_async_and_wait_invoke + 175
    28  libdispatch.dylib                   0x000000010a6b0a88 _dispatch_client_callout + 8
    29  libdispatch.dylib                   0x000000010a6bef23 _dispatch_main_queue_callback_4CF + 1152
    30  CoreFoundation                      0x00007fff203a8276 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    31  CoreFoundation                      0x00007fff203a2b06 __CFRunLoopRun + 2685
    32  CoreFoundation                      0x00007fff203a1b9e CFRunLoopRunSpecific + 567
    33  GraphicsServices                    0x00007fff2b773db3 GSEventRunModal + 139
    34  UIKitCore                           0x00007fff24660af3 -[UIApplication _run] + 912
    35  UIKitCore                           0x00007fff24665a04 UIApplicationMain + 101
    36  XXXX                                0x0000000106de2d69 main + 153
    37  libdyld.dylib                       0x00007fff20257415 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't get value for 'batch' in bindings {
}.'

您可以将批大小设置为0
[NSManagedObject MR_setDefaultBatchSize:0],但检查之后的性能。

是否为“客户”NSManageObject类型?如果是,请检查是否有故障,这似乎可以为我解决问题