0

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) sqlite3 *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?

5 Answers 5

1

use

#import "SQLiteDB.h" 

in SampleAppDelegate.m

Sign up to request clarification or add additional context in comments.

2 Comments

+1 one for beating me by a minute and the other two by five seconds and seven seconds respectively.
I guess that should have been obvious, but since I'm a newbie and definitely struggeling with this, it isn't. Thank you so much for your time. :D
0

In SampleAppDelegate.m include the following line:

#import "SQLiteDB.h"

Comments

0

You need:

#import "SQLiteDB.h" in SampleAppDelegate.m or .h

Comments

0

You need to #import SQLiteDB.h into SampleAppDelegate.m

Comments

0

You probably need to #import "SQLiteDB.h" in SampleAppDelegate.m

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.