FROM : Matt Neuburg
DATE : Wed Aug 16 18:51:19 2006
On Mon, 14 Aug 2006 14:51:30 -0700 (PDT), joe OneNinetyTwo
<<email_removed>> said:
>I have a model object called DataSet in MyDocument
>class that is a composite of two NSMutable arrays
>
>@interface DataSet : NSObject {
> NSMutableArray *data;
> NSMutableArray *dimensions;
>}
>
>The data array holds Datum objects
>@interface Datum : NSObject {
> float real;
> float imaginary;
>}
>and the dimensions array holds dimension objects
>@interface Dimension : NSObject <NSCoding, NSCopying>
>{
> unsigned npts;
> double dwellTime;
> double initialTime;
> double centerFrequency;
>}
>
>I've created two TableViews in the window in
>MyDocument.nib, one for data and one for dimensions.
>I have two NSArrayControllers in the nib called
>DataController and DimensionsController. Can I bind
>my model objects to the controllers using dot
>separated key paths like dimension.npts and
>datum.real, or am I going about this all wrong.
You do not want to bind your model objects to the controllers; you want to
bind the controllers to MyDocument (because that is where the DataSet model
object is) or to an instance of DataSet that is instantiated in the nib. If
the former, the key paths must include the path to the DataSet model object
(at the start). Everything you do must be KVC / KVO compliant so that the
controllers can see the changes.
>I originally had the two arrays data and dimensions
>inside MyDocument, and everything (tableview and
>bindings) was working fine. It's only after I put
>them inside the DataSet Object that I'm having
>problems geting it working again.
If you want specific help, say specifically what you did and specifically
what the "problems" are. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
DATE : Wed Aug 16 18:51:19 2006
On Mon, 14 Aug 2006 14:51:30 -0700 (PDT), joe OneNinetyTwo
<<email_removed>> said:
>I have a model object called DataSet in MyDocument
>class that is a composite of two NSMutable arrays
>
>@interface DataSet : NSObject {
> NSMutableArray *data;
> NSMutableArray *dimensions;
>}
>
>The data array holds Datum objects
>@interface Datum : NSObject {
> float real;
> float imaginary;
>}
>and the dimensions array holds dimension objects
>@interface Dimension : NSObject <NSCoding, NSCopying>
>{
> unsigned npts;
> double dwellTime;
> double initialTime;
> double centerFrequency;
>}
>
>I've created two TableViews in the window in
>MyDocument.nib, one for data and one for dimensions.
>I have two NSArrayControllers in the nib called
>DataController and DimensionsController. Can I bind
>my model objects to the controllers using dot
>separated key paths like dimension.npts and
>datum.real, or am I going about this all wrong.
You do not want to bind your model objects to the controllers; you want to
bind the controllers to MyDocument (because that is where the DataSet model
object is) or to an instance of DataSet that is instantiated in the nib. If
the former, the key paths must include the path to the DataSet model object
(at the start). Everything you do must be KVC / KVO compliant so that the
controllers can see the changes.
>I originally had the two arrays data and dimensions
>inside MyDocument, and everything (tableview and
>bindings) was working fine. It's only after I put
>them inside the DataSet Object that I'm having
>problems geting it working again.
If you want specific help, say specifically what you did and specifically
what the "problems" are. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
| Related mails | Author | Date |
|---|---|---|
| Kam Dahin | Aug 14, 22:16 | |
| joe OneNinetyTwo | Aug 14, 23:51 | |
| Matt Neuburg | Aug 16, 18:51 | |
| joe OneNinetyTwo | Aug 17, 02:34 |






Cocoa mail archive

