希望这将是一个快速解决方案.我一直试图弄清楚我一直在犯的错误.下面列出了错误,并且appdelagate低于该错误.
任何帮助表示赞赏.
谢谢
2012-04-12 21:11:52.669 Chanda [75100:f803] ---断言失败
-[UITableView _endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:10372012-04-12 21:11:52.671 Chanda [75100:f803] ---由于未被捕获的异常终止app'NSInternalInconsistencyException' ,原因:'无效更新:第0节中的行数无效.更新后的现有部分中包含的行数(2)必须等于更新前该部分中包含的行数(2),再加上或减去从该部分插入或删除的行数(插入1个,删除0个),加上或减去移入或移出该部分的行数(0移入,0移出).
#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 …Run Code Online (Sandbox Code Playgroud)