Adding holder relationship


#1

When I type in the coding in Asset.m (i’m using Xcode 4.2.1), page 126
I’m getting 3 errors:
error 1: !expected identifier and !Expression result unused
error 2: use of undeclared identifier ‘dealloc’: did you mean ‘realloc’?
error 3: extraneous “)” before ‘;’

#import “Asset.h”
#import “Employee.h”

@implementation Asset

@synthesize label, resaleValue, holder;

-(NSString *)description
{

if ([self holder]) {
    return [NSString stringWithFormat: @"<%@: $%d, assigned to %@>", 
            [self label], [self resaleValue], [self,holder]; //error 1
}else{
return [NSString stringWithFormat:@"<%@: $%d >", [self label], [self resaleValue]];
}

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

@end

I’m typing in exactly as I see it, am i missing something?
Thanks.


#2

[self,holder] should be [self holder] (no comma)

Try fixing that; the rest looks reasonable. Sometimes one good syntax error can really confuse a compiler.


#3

thanks Aaron!
ugh…1 comma…