Here's my code:
(from SQLiteDB.h)
#import <sqlite3.h>
@interface SQLiteDB : NSObject {
NSString *dbPath;
int databaseKey;
sqlite3 *db;
}
//@property (nonatomic, copy) NSString *db;
@property (nonatomic, copy) NSString *dbPath;
@property (nonatomic) 开发者_如何学Pythonsqlite3 *db;
@property (nonatomic) int databaseKey;
@end
=============== (from SQLiteDB.m)
#import "SQLiteDB.h"
@implementation SQLiteDB
@synthesize db, dbPath, databaseKey;
@end
=============== (from SampleAppDelegate.m)
#import "ReaderSampleAppDelegate.h"
#import "ReaderSampleViewController.h"
@implementation ReaderSampleAppDelegate
@synthesize window;
@synthesize viewController;
#pragma mark -
#pragma mark Application lifecycle
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// create the d/b or get the connection value
SQLiteDB *dbInstance = [[SQLiteDB alloc] init]; // Error here <---------
}
==================
Error is: SQLiteDB undeclared.
I thought I did declare it in SQLiteDB.h? How do I fix this?
use
#import "SQLiteDB.h"
in SampleAppDelegate.m
In SampleAppDelegate.m
include the following line:
#import "SQLiteDB.h"
You need:
#import "SQLiteDB.h" in SampleAppDelegate.m or .h
You need to #import SQLiteDB.h
into SampleAppDelegate.m
You probably need to #import "SQLiteDB.h"
in SampleAppDelegate.m
精彩评论