Reputation: 402
I am a little lost as to why I am getting this error. Pretty much, I am abstracting some code to make a helper class that lets me reuse colors I use through out my app. The reason I don't understand why I am getting this error is because when I import my class to my NC Widget, no complaints. However, when I import my class to my TableViewController that is the base for my tableviews in my app, I get this error. UIKit is added to my frameworks, so I am not sure what I am doing wrong.
#import <UIKit/UIKit.h>
@interface ColorPalette : UIColor
+(UIColor *)setColorRed;
+(UIColor *)setColorBlue;
+(UIColor *)setColorGreen;
+(UIColor *)setColorOrange;
@end
And
#import "ColorPalette.h"
@implementation ColorPalette
+(UIColor *)setColorRed{
return [UIColor colorWithRed:204/255.0f green:25/255.0f blue:36/255.0f alpha:1.0f];
}
+(UIColor *)setColorGreen{
return [UIColor colorWithRed:29/255.0f green:156/255.0f blue:48/255.0f alpha:1.0f];
}
+(UIColor *)setColorBlue{
return [UIColor colorWithRed:67/255.0f green:174/255.0f blue:249/255.0f alpha:1.0f];
}
+(UIColor *)setColorOrange{
return [UIColor colorWithRed:237/255.0f green:145/255.0f blue:50/255.0f alpha:1.0f];
}
@end
So when I import it to my table view:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ColorPalette", referenced from:
objc-class-ref in TableView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Top of .m TableView File
#import "TableView.h"
#import "ColorPalette.h"
Top of .h TableViewFile
#import <UIKit/UIKit.h>
@interface TableView : UIViewController <UITableViewDataSource, UITableViewDelegate>
Upvotes: 1
Views: 317
Reputation: 42449
Make sure your Tableview.m
file listed under Target -> Build Phases -> Compile Sources.
Upvotes: 2