• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: IB palette mojo
  • Next by Date: Re: IB palette mojo
  • Previous by thread: Re: IB palette mojo
  • Next by thread: Re: NSObjectController: What is the proper way to populate File Owner's NSMutableDictionary?
  • Index(es):
    • Date
    • Thread