- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
希望这将是一个快速修复。我一直在试图找出我不断遇到的错误。错误在下面列出,appdelagate 在下面。
感谢任何帮助。
谢谢
2012-04-12 21:11:52.669 Chanda[75100:f803] --- Assertion failure in
-[UITableView _endCellAnimationsWithContext:]
,/SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:1037
2012-04-12 21:11:52.671 Chanda[75100:f803] --- 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 (2) must be equal to the number of rows contained in that section before the update (2), 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).'
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize databaseName,databasePath;
- (BOOL)application: (UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
self.databaseName = @"Customers.db";
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDir = [documentPaths objectAtIndex:0];
self.databasePath = [documentDir stringByAppendingPathComponent:self.databaseName];
[self createAndCheckDatabase];
return YES;
}
- (void)createAndCheckDatabase {
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
success = [fileManager fileExistsAtPath:databasePath];
if (success) return;
NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:self.databaseName];
[fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
}
@end
最佳答案
我看不出您向我们展示这部分代码的原因。您的错误必须与我假设的代码中的这一部分有关
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
您可能在其中一种数据源方法中犯了错误。目前不可能说出究竟是什么问题,但我认为可能是这样的:您正在告诉 numberOfRowsInSection
中的 TableView 您希望保留 n 行并且设置并在 cellForRowAtIndexPath
中,然后您只处理 n - 1 行。
很抱歉,这个答案可能不够准确。如果您向我们展示您对数据源的实现,则更容易了解发生了什么。
关于objective-c - -[UITableView _endCellAnimationsWithContext :] 中的断言失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10134841/
我充其量只是一个业余爱好者,并坚持这个错误!肯定是一些简单的事情...... - (void)addTapped:(id)sender { TechToolboxDoc *newDoc = [[Tec
这个问题在这里已经有了答案: 'Invalid update: invalid number of rows in section 0 (5 个答案) 关闭 9 年前。
我正在解析一个 xml 文件并将其解析的值放在 TableView 中。 TableView 只有一个部分。但我遇到以下异常: 2013-10-14 15:21:57.250 tableview[60
希望这能快速解决。我一直在试图找出我不断遇到的错误。下面列出了错误,应用程序延迟在下面。 感谢任何帮助。 谢谢 2012-04-12 21:11:52.669 Chanda[75100:f803] -
我有 2 个托管对象上下文:(1) 创建为 NSMainQueueConcurrencyType,供 UI/主线程使用,(2) 创建为 NSPrivateQueueConcurrencyType,供
希望这将是一个快速修复。我一直在试图找出我不断遇到的错误。错误在下面列出,appdelagate 在下面。 感谢任何帮助。 谢谢 2012-04-12 21:11:52.669 Chanda[7510
我的应用程序崩溃,并显示在该线程标题中的消息。 UITableView.m中的断言失败。此外,在Xcode的调试窗口中还有以下消息。 Terminating app due to uncaught e
当我在 View Controller 或表格 View Controller 中回击时出现此错误。 返回是导航栏上的一个栏按钮项目,它被返回到前一个 Controller 或我的主目录 tablev
我正在实现一个 UITableView。我也在使用 CoreData。它工作正常但是当我尝试删除一行时出现此错误: Assertion failure in -[UITableView _endCel
我正在使用 UITableView 向用户显示一些设置。当重新加载一个部分或插入一些带有动画的行时,可能会在委托(delegate)/数据源函数中出错导致 Assertion failure in -
从我的 PFTableViewController 中删除图像时出现此错误。我已经进行了广泛的搜索,据我所知,commitEditingStyle 中的代码是正确的。谁能帮忙? import Foun
我在转换为 Swift 的一些代码时遇到了一个大问题。调用 self.tableView.endUpdates() 时,我的 TableView 保持为空,并且出现以下错误: Assertion fa
我愿意删除单元格并在PFQueryViewController的单元格中显示重载tableView。 但是,当我删除并刷新TableView时,出现错误:“***-[UITableView _endC
应用程序将照片上传到服务器。 当用户选择上传某些照片时,照片的信息将保存到核心数据中。使用 fetchedResultsController 填充一个表格 View ,显示照片列表。 表格 View
我在 UITablViewSource 中使用以下代码 public override UITableViewCell GetCell (UITableView tableView, NSIndex
我正在项目中实现一个可编辑的表格 View 。当我点击左侧滑动后显示的红色 Delete 按钮时,应用程序崩溃了。控制台日志在这里: *** -[UITableView _endCellAnimati
我是一名优秀的程序员,十分优秀!