Re: Object Instantiation Q.
Re: Object Instantiation Q.
- Subject: Re: Object Instantiation Q.
- From: Robert Cerny <email@hidden>
- Date: Mon, 15 Dec 2003 14:42:15 +0100
Well,
you can't make the right connection in the init method, because all
needed steps are not done yet. Use -awakeFromNib instead.
HTH
Robert
On 14.12.2003, at 17:48, Ian McGregor wrote:
>
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.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.