NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
- Subject: NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
- From: "Frederick C. Lee" <email@hidden>
- Date: Mon, 26 Dec 2005 21:19:31 -0800
Greetings:
I'm trying to populate a simple NSMutableDictionary within a
NSPersistentDocument (File's Owner) object with the contents of a
screen.
I'm using a NSObjectController to map the fields of the screen to a
NSMutableDictionary instantiated object within the NSPersistentDocument.
I have the accessor routines to access the NSMutableDictionary object.
So the scenario is:
Screen Fields --> NSObjectController --> NSPersistentDocument
(NSMutableDictionary)
The Fields are:
newImage {NSImage} <<-- NSData
newName {NSTextField}, <--- NSString
newRegion {NSMatrix (radio buttons)}, <-- using cell tags for ID
newMemo {NSTextView} <-- NSAttributeString
----------
Chosen Properties of NSObjectContoller:
Attributes:
Object Class Name: NSMutableDictionary {keys: newName,
newImage, newMemo, newRegion}
Bindings: Controller Content:
contentObject: {file's owner (NSPersistentDocument}
'Add' button is connected to the NSObjectController.
-----------
Bindings of Fields:
newName (NSTextField)
Value: Bind To: NSObjectController
Controller Key: Selection
Model Key Path: newName
newMemo (NSTextView) <-- NSString for now, binary later.
Data: Bind To: NSObjectController
Controller Key: Selection
Model Key Path: newMemo
newRegion (NSMatrix (radio buttons))
Value Bind To: selectedTag (NSObjectController)
Controller Key: Selection
Model Key Path: newRegion
newImage (NSImage)
Data: Bind To: NSObjectController
Controller Key: Selection
Model Key Path: newRegion
Value Transformer: NSUnarchiveFromData
===============================================
Outcome:
1) The 'Add' button doesn't appear to do anything.
2) I'm only getting the 'newRegion' and 'newName' data (in Real Time
- regardless of 'Add' button).
This is what I got via GDB:
(gdb) po [self newGeoEntity]
<NSCFDictionary 0x375600>{
Default Entity = name; <-- what is this?
newRegion = 3; <-- tag ID
newName = My Name;
}
Question: Am I doing this right? - Why don't I get the newMemo
(NSString) and newImage (NSImage) data?
Regards,
Ric.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden