Trying to import a custom UITableViewCell and it keeps giving me a file not found lexical preprocessor error. I can't figure it out.
ProductCell.h
#import <UIKit/UIKit.h>
@interface ProductCell : UITableViewCell {
IBOutlet UILabel *descript;
IBOutlet UILabel *productCode;
IBOutlet UIImageView *prodImage;
}
@property (nonatomic, retain) IBOutlet UILabel *descript;
@property (nonatomic, retain) IBOutlet UILabel *productCode;
@property (nonatomic, retain) IBOutlet UIImageView *prodImage;
@end
ProductCell.m
#import "ProductCell.h"
@implementation ProductCell
@synthesize descript;
@synthesize productCode;
@synthesize prodImage;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (void)dealloc
{
[super dealloc];
}
@end
In my UItableviewcontroller.h file I've tried to import as @class
and not doesnt seem to make a difference. and in my implementation file i simply
#import "ProductCell.h"
why is this? what basic step am I missing. Importing it in implementation file should solve my issue. Tried cleaning project
Renaming the header file to something else and renaming it back to its original name did solve the problem for me.
This appears to be an XCode4 bug. Despite the fact that the compiler shows an error, if you try running the project, it should work.
This is discussed in the Apple forums in the following places:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With