SpokaneDude
SpokaneDude

Reputation: 4974

Xcode Build errors (newbie)

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?

Upvotes: 0

Views: 117

Answers (5)

joerick
joerick

Reputation: 16448

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

Upvotes: 0

JeremyP
JeremyP

Reputation: 86651

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

Upvotes: 0

davidstites
davidstites

Reputation: 687

You need:

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

Upvotes: 0

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181270

In SampleAppDelegate.m include the following line:

#import "SQLiteDB.h"

Upvotes: 0

roman
roman

Reputation: 11278

use

#import "SQLiteDB.h" 

in SampleAppDelegate.m

Upvotes: 1

Related Questions