简体   繁体   中英

Referenced Error in iphone sdk?

In my app, i made a Core.h file & declare some methods. In other files, i import `core.h', make a object of it and call methods through object still it does not show me any error.

But When try to run my app, It shows error Like:

Undefined symbols for architecture i386:

"_OBJC_CLASS_$_Core", referenced from:

  objc-class-ref in ReadingDatabaseAppDelegate.o
  objc-class-ref in HomeController.o

My code:

// HomeController.h

#import "Core.h"


//HomeController.m

- (void)startInitialising:(id)sender
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];    

    //NSLog(@"%@ %@", [UIDevice currentDevice].systemName, [UIDevice currentDevice].systemVersion);

    Core *coreObj = [[Core alloc] init];
    threadArray = [coreObj getPreferences];
    threadPrefereneRow = [coreObj getSavedPreferene];
    threadLastUpdated = [coreObj getSavedRequestTime];
    threadNumberOfUpdates = [coreObj getNumberOfUpdates:threadLastUpdated];
    [coreObj release];

    [[NSNotificationCenter defaultCenter] postNotificationName:FinishInitializing object:nil];
    [pool release];
}


-(void) finishInitializingHandler: (NSNotification *) sender
{
Core *coreObj = [[Core alloc] init];
    [coreObj setTabbarSyncValue:tabBar];
    [coreObj release];
}

How can i solve this

A header file by itself isnt enough. You need the matching implementation file (either as .m file, a .a library, a dylib or a framework.


simplified:

think of .h files as a bookmark to webpages
(they contain a link and a description but no actual content)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM