Adding holder relationship


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
return [NSString stringWithFormat:@"<%@: $%d >", [self label], [self resaleValue]];

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


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


[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.


thanks Aaron!
ugh…1 comma…