Re: CoreData relationships in IB
Re: CoreData relationships in IB
- Subject: Re: CoreData relationships in IB
- From: T Reaves <email@hidden>
- Date: Sun, 22 May 2005 16:22:45 -0400
On May 22, 2005, at 3:12 PM, mmalcolm crawford wrote:
On May 22, 2005, at 11:44 AM, T Reaves wrote:
I have a UI setup to display and edit CoreData objects. I
have ObjectA and ObjectB; ObjectA contains an ObjectB. On my UI I
have fields for both ObjectA and ObjectB. The fields for ObjectB
are bound to objectB.field. All well and good.
OK...
It does not appear that CoreData and the object controllers
can instantiate the instance of ObjectB when objectB.field is
set. Is this correct?
In what sense do you mean objectB.field is set?
I mean that I have a text field bound to
selection.objectB.someValue of a given array controller that is
representing a CoreData entity. I then compile the application, run
it, and enter some value into the text fields. I then exit the
application.
Do I have to go ahead and create .h & .m files for my objects, and
do the initialization of the contained objects there? Or is there
a way to set this up in CoreData nd IB?
I'm not sure what is the relevance of the .h and .m files?
If CoreData/IB does not know how to instantiate an instance of
the contained object (ObjectA contains an instance of ObjectB), then
I would have to create ObjectA.h & ObjectA.m, and in the init method
(or somewhere equivalent), I would have to programatically create an
instance of ObjectB and set it to the instance variable in ObjectA like:
init
{
objectB = [ObjectB new];
}
_______________________________________________
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