Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 13, 2008, 05:33 PM   #1
NSNick
macrumors regular
 
Join Date: Jun 2008
Location: Washington D.C.
2008-07-13 18:25:21.027 RaiseMan[9684:10b] *** -[NSUserDefaults setObject:forKey:]: A

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
NSNick is offline   0 Reply With Quote
Old Jul 13, 2008, 06:30 PM   #2
Darkroom
Guest
 
Join Date: Dec 2006
Location: Montréal, Canada
hey... i've noticed you're reading cocoa programming (3rd)... not sure if you know already, but there are solutions on their website (bignerdranch.com) that you can download and compare to your own code if you're having problems (although some of the solutions are not exactly as they are written in the book)... that being said, i still think it good practice to write the code out yourself following the book so you can get use to some of the syntax, etc..

also, you should use the "[ code ]" "[ /code ]" tags when you post code on this board... it makes it easier to read...
Darkroom is offline   0 Reply With Quote
Old Jul 13, 2008, 06:32 PM   #3
Mac Player
macrumors regular
 
Join Date: Jan 2006
Most likely the error is in the bindings you did on interface builder.
Mac Player is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Locked file - i ain't no newbie - read on...: bizzeebeever Mac Basics and Help 1 Feb 3, 2010 02:34 PM
The new powerbook - a question : ) !!! igmolinav Buying Tips, Advice and Discussion (archive) 3 Sep 14, 2005 04:20 AM
Need PHP Help - Passing a : From Flash Cooknn Web Design and Development (archive) 3 Mar 17, 2005 10:42 AM


All times are GMT -5. The time now is 11:55 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC