うまくいけば、これは迅速な修正になるでしょう。私は取得し続けるエラーを理解しようとしています。エラーは以下にリストされており、appdelagate はその下にあります。
どんな助けでも大歓迎です。
ありがとう
2012-04-12 21:11:52.669 Chanda[75100:f803] --- でのアサーションの失敗
-[UITableView _endCellAnimationsWithContext:]
、/SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:1037
2012-04-12 21:11:52.671 Chanda[75100:f803] --- 例外がキャッチされていないため、アプリを終了しています '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 = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:self.databaseName];
[fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
}
@end