Object Instantiation Q.
Object Instantiation Q.
- Subject: Object Instantiation Q.
- From: Ian McGregor <email@hidden>
- Date: Sun, 14 Dec 2003 08:48:50 -0800
I have a datasource object, in this case for an NSOutlineView. I am
confused on which is the best place to instantiate this object, in IB
or in MyDocument. I have tried both with varying degrees of success.
Scenario 1 - Instantiate DataSource in MyDocument
-----------------------------------------------------------------------
MyDocument allocates and deallocates, as well as tells the outlineview
that the newly allocated datasource is its delegate and datasource.
Scenario 2 - Instantiate DataSource in IB
-------------------------------------------------------
My datasource object tells the outlineview that it is the datasource
and delegate during its init. It also sets up dragging etc. There is an
outlet connecting MyDocument to the DataSource object in IB.
The problem is that in Scenario 2, the data the outlet between
MyDocument and the Datasource object does not covey the current
information in the datasource. For example, I cannot load and save the
object , nor alter its contents. Where as, in scenario 1 this all seems
to work.
Any ideas? I'd like to use the 2nd method, I know this is
back-to-basics, but I am really missing something here.
Thanks,
Ian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.