What does this error mean
2008-07-13 18:25:21.027 RaiseMan[9684:10b] *** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value '(
<Person: 0x18ecc0>
)' of class 'NSCFArray'.
in relation to this code
#import <Cocoa/Cocoa.h>
@interface MyDocument : NSDocument {
NSMutableArray *employees;
}
-(void)setEmployeesNSMutableArray *)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)setEmployeesNSMutableArray *)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
2008-07-13 18:25:21.027 RaiseMan[9684:10b] *** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value '(
<Person: 0x18ecc0>
)' of class 'NSCFArray'.
in relation to this code
#import <Cocoa/Cocoa.h>
@interface MyDocument : NSDocument {
NSMutableArray *employees;
}
-(void)setEmployeesNSMutableArray *)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)setEmployeesNSMutableArray *)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