|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
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)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 |
|
|
|
0
|
|
|
#2 |
|
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... |
|
|
|
0
|
|
|
#3 |
|
Most likely the error is in the bindings you did on interface builder.
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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.




NSMutableArray *)a;

Linear Mode

