Error: receiver type 'Asset' is a forward decl


#1

I got this error:

It appeared in Employee.m:

[code]//
// Employee.m
// BMITime
//

#import “Employee.h”

@implementation Employee

@synthesize employeeID;

-(void)addAssetsObjects:(Asset *)a
{
//Is Assents nil?
if (!assets){

    //Create the array
    assets = [[NSMutableArray alloc] init];
}
[assets addObject:a];

}

-(unsigned int)valueOfAssets
{
//Sum up the resale value of the assets
unsigned int sum = 0;
for (Asset *a in assets) {
sum += [a resaleVale];
}
return sum;
}

-(float)bodyMassIndex
{
float normalBMI = [super bodyMassIndex];
return normalBMI * 0.9;
}

-(NSString *)description
{
return [NSString stringWithFormat:@"<Employee %d: %d in assets>",
[self employeeID], [self valueOfAssets]];
}

-(void)dealloc
{
NSLog(@“deallocating %@”, self);
}

@end
[/code]

Here’s Employee.h, just in case:

[code]//
// Employee.h
// BMITime
//

#import <Foundation/Foundation.h>
#import “Person.h”
@class Asset;

@interface Employee : Person
{
int employeeID;
NSMutableArray *assets;
}
@property int employeeID;

  • (void)addAssetsObjects:(Asset *)a;
  • (unsigned int)valueOfAssets;

@end
[/code]

What’s the problem with the code?


#2

Nevermind, a few spelling errors and forgetting to import Asset.h into Employee.m