Yahya Arshad
Yahya Arshad

Reputation: 1626

Getting Strange Error Running Objective C Code

My project have no visible error but when i try to run it gives following error

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ConcreteScreen", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using my ContactScreen class in ViewController.m

i tried by @class ContactScree and #import "ContactScreen.h"

and in my ViewController i am using it as [ContactScreen myMethod]; when i comment out this line it work fine but now it is giving compile time error :( yesterday it was wroking fine

here is my code

#import "ViewController.h"


#import "ConcreteScreen.h"
@interface ViewController ()

@end

@implementation ViewController




-(IBAction)btnContactPress:(id)sender{
   NSLog(@"Contact Screen");

    ConcreteScreen *coontact = [[ConcreteScreen alloc]init];

}

Upvotes: 0

Views: 69

Answers (2)

Oleg Trakhman
Oleg Trakhman

Reputation: 2082

You confused ConcreteScreen and ContactScreen and compiler told you that it isn't aware about ConcreteScreen

Upvotes: 2

bubbles
bubbles

Reputation: 11

Be sure your .m file is included in the project. It's possible to create it, use the header and all but it doesn't go into the build. Also it needs to be in the target.

Upvotes: 1

Related Questions