我相信我可以在某处关闭该错误!查看以下引发此错误的代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSString *databaseName = @"TasksDB.db";
NSArray *documentsDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [documentsDir objectAtIndex:0];
databasePath = [documentsDirectoryPath stringByAppendingPathComponent:databaseName];
[self checkAndCreateDatabase];
// Override point for customization after application launch.
return YES;
}
-(void) checkAndCreateDatabase
{
}
抛出 checkAndCreateDatabase 无法识别的错误。这也是因为我没有在接口文件中声明 checkAndCreate... 方法,我不想这样做。