Re: NSObjectController: can't populate all elements of NSMutableDictionary in File's Owner (part deux)
Re: NSObjectController: can't populate all elements of NSMutableDictionary in File's Owner (part deux)
- Subject: Re: NSObjectController: can't populate all elements of NSMutableDictionary in File's Owner (part deux)
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 27 Dec 2005 11:59:20 -0800
On Dec 27, 2005, at 9:07 AM, Frederick C. Lee wrote:
The target: newGeoEntity (NSMutableDictionary) in File's Owner
(NSPersistentDocument)
Given that you're using a persistent document, and called the
variable newGeo*Entity*, are you sure the object controller is
supposed to be managing a dictionary?
This is what the debugger shows after I filled out each field and
looked 'under the covers':
(gdb) po [self newGeoEntity]
<NSCFDictionary 0x375650>{
Default Entity = name;
newRegion = 3; <---- NSMatrix binds okay.
newName = This is the Name Field; <--- NSTextField binds okay.
}
-----------------------
I looks like the NSObjectController is *partially* working.
a) The 'newName' (NSTextField) & newRegion (NSMatrix) are binding
correctly.
b) But the newMemo field (NSTextView) and newMap (NSImageView) ARE
NOT BOUND.
In what sense "not bound"? Presumably they are bound, but don't work
as you are expecting?
c) When I set the NSTextView's attribute to work only with NSString
(not allowing change of fonts), the compiler bombs.
Presumably you get a runtime error? I'm not sure how this would
cause the compiler to fail?
newMemo Value binding:
data = selection.newMemo [NewGeoData (NSObjectController)]
newMap Value binding:
data = NSUnarchiveFromData(selection.newMap) [NewGeoData
(NSObjectController)]
Questions:
1) Why do I get the following compiling error if I set
NSTextView's 'Allow User to Change Fonts' attribute to FALSE
(deselect it)?
2005-12-27 08:57:28.358 Global Village[3532] [<NSTextView 0x3ba9b0>
valueForUndefinedKey:]: this class is not key value coding-
compliant for the key data.
At what stage does this error appear? Are you opening an existing
document? If so, where does the data for this document come from?
2) Why don't I see data for the NSImageView within
newGeoEntity (NSMutableDictionary) -- am I using the wrong
Value Transformer (NSUnarchiveFromData)? -- It
appears I need the 'archve to data'--> into a NSData object.
Do you want an NSImage object or the actual image data? Where does
the image come from (how have you set it)? See also <http://
developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/
BindingsText/NSImageView.html>.
3) What's with the 'Default Entity - name'; found in
newGeoEntity (NSMutableDictionary)?
Have you at some stage set up the object controller to use a managed
object?
_______________________________________________
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