what error mean
2008-07-13 18:25:21.027 raiseman[9684:10b] *** -[nsuserdefaults setobject:forkey:]: attempt insert non-property value '(
<person: 0x18ecc0>
)' of class 'nscfarray'.
in relation code
#import <cocoa/cocoa.h>
@interface mydocument : nsdocument {
nsmutablearray *employees;
}
-(void)setemployees
nsmutablearray *)a;
@end
#import "mydocument.h"
@implementation mydocument
-(id)init
{
[super init];
employees = [[nsmutablearray alloc] init];
return self;
}
-(void)dealloc
{
[self setemployees:nil];
[super dealloc];
}
-(void)setemployees
nsmutablearray *)a
{
if (a == employees)
return;
[a retain];
[employees release];
employees = a;
}
@end
#import <foundation/foundation.h>
@interface person : nsobject {
nsstring *personname;
float expectedraise;
}
@property (readwrite, copy) nsstring *personname;
@property (readwrite) float expectedraise;
@end
#import "person.h"
@implementation person
-(id)init
{
[super init];
expectedraise = 5.0;
personname = @"new person";
return self;
}
-(void)dealloc
{
[personname release];
[super dealloc];
}
@synthesize personname;
@synthesize expectedraise;
@end
hey... i've noticed you're reading cocoa programming (3rd)... not sure if know already, there solutions on website (bignerdranch.com) can download , compare own code if you're having problems (although of solutions not written in book)... being said, still think practice write code out following book can use of syntax, etc..
also, should use "[ code ]" "[ /code ]" tags when post code on board... makes easier read...
Forums Macs Mac Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
Comments
Post a Comment