這裏是我的代碼:
(從SQLiteDB.h)Xcode中生成錯誤(新手)
#import <sqlite3.h>
@interface SQLiteDB : NSObject {
NSString *dbPath;
int databaseKey;
sqlite3 *db;
}
//@property (nonatomic, copy) NSString *db;
@property (nonatomic, copy) NSString *dbPath;
@property (nonatomic) sqlite3 *db;
@property (nonatomic) int databaseKey;
@end
=============== (從SQLiteDB。米)
#import "SQLiteDB.h"
@implementation SQLiteDB
@synthesize db, dbPath, databaseKey;
@end
=============== (從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 <---------
}
==================
錯誤是:SQLiteDB未聲明。
我以爲我確實在SQLiteDB.h中聲明瞭它?我該如何解決?
+1一個由一分鐘,分別在另兩個在五秒7秒打我。 – JeremyP 2011-03-07 20:02:33
我想這應該是顯而易見的,但因爲我是一個新手,並且肯定會對此非常困難,事實並非如此。非常感謝您的參與。 :d – SpokaneDude 2011-03-07 20:02:52