gpt4 book ai didi

iOS 应用因未捕获的 NSException 而终止

转载 作者:行者123 更新时间:2023-11-29 02:03:23 24 4
gpt4 key购买 nike

我是 iOS 编程的新手,我正在学习旧教程。当我运行我的应用程序时,我不断收到错误消息。它说,“NSException 类型的未捕获异常。”我很迷茫,以下是调试器。

2015-05-06 18:55:11.118 Gilligizer[5728:196574] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001112a8c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010fffcbb7 objc_exception_throw + 45
2 CoreData 0x000000010fc55304 -[NSManagedObjectContext executeFetchRequest:error:] + 4740
3 CoreData 0x000000010fd6bace __43-[NSFetchedResultsController performFetch:]_block_invoke + 270
4 CoreData 0x000000010fd39c30 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 192
5 libdispatch.dylib 0x0000000115085614 _dispatch_client_callout + 8
6 libdispatch.dylib 0x000000011506b002 _dispatch_barrier_sync_f_invoke + 365
7 CoreData 0x000000010fd29ec6 -[NSPersistentStoreCoordinator performBlockAndWait:] + 198
8 CoreData 0x000000010fd6b8dc -[NSFetchedResultsController performFetch:] + 572
9 Gilligizer 0x000000010e1e3180 -[MasterViewController fetchedResultsController] + 720
10 Gilligizer 0x000000010e1e276a -[MasterViewController numberOfSectionsInTableView:] + 58
11 UIKit 0x000000010e518b03 -[UITableViewRowData _updateNumSections] + 84
12 UIKit 0x000000010e5194f4 -[UITableViewRowData invalidateAllSections] + 69
13 UIKit 0x000000010e36477b -[UITableView _updateRowData] + 217
14 UIKit 0x000000010e37aa1f -[UITableView numberOfSections] + 27
15 UIKit 0x000000010e5810d5 -[UITableViewController viewWillAppear:] + 97
16 UIKit 0x000000010e3c0fa1 -[UIViewController _setViewAppearState:isAnimating:] + 487
17 UIKit 0x000000010e3ed921 -[UINavigationController _startTransition:fromViewController:toViewController:] + 793
18 UIKit 0x000000010e3ee448 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
19 UIKit 0x000000010e3eef0e -[UINavigationController __viewWillLayoutSubviews] + 43
20 UIKit 0x000000010e539715 -[UILayoutContainerView layoutSubviews] + 202
21 UIKit 0x000000010e30ca2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
22 QuartzCore 0x0000000111b3aec2 -[CALayer layoutSublayers] + 146
23 QuartzCore 0x0000000111b2f6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
24 QuartzCore 0x0000000111b2f546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
25 QuartzCore 0x0000000111a9b886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
26 QuartzCore 0x0000000111a9ca3a _ZN2CA11Transaction6commitEv + 462
27 UIKit 0x000000010e28aa2d -[UIApplication _reportMainSceneUpdateFinished:] + 44
28 UIKit 0x000000010e28b6f1 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2648
29 UIKit 0x000000010e28a0d5 -[UIApplication workspaceDidEndTransaction:] + 179
30 FrontBoardServices 0x00000001103a45e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
31 CoreFoundation 0x00000001111dc41c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
32 CoreFoundation 0x00000001111d2165 __CFRunLoopDoBlocks + 341
33 CoreFoundation 0x00000001111d1947 __CFRunLoopRun + 887
34 CoreFoundation 0x00000001111d1366 CFRunLoopRunSpecific + 470
35 UIKit 0x000000010e289b42 -[UIApplication _run] + 413
36 UIKit 0x000000010e28c900 UIApplicationMain + 1282
37 Gilligizer 0x000000010e1e15cf main + 111
38 libdyld.dylib 0x00000001150b9145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

最佳答案

根据崩溃日志判断,您错过了在核心数据获取请求中提供实体。

关于iOS 应用因未捕获的 NSException 而终止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30090703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com