Re: Using bindings across frameworks
Re: Using bindings across frameworks
- Subject: Re: Using bindings across frameworks
- From: Bob Peterson <email@hidden>
- Date: Sun, 19 Dec 2004 13:41:09 -0500
You were right, I wasn't able to directly alloc and init MyItem. In
fact MyItemList, which is instantiated by MyManager, was getting nil
back.
It turns out I had misconfigured my XCode project when I tried to split
the project into multiple build targets. I rebuilt it, separating each
target's files into separate folders. I made sure there were clearly
separate Info.plist files, and the INFOPLIST_FILE build setting for
each target pointed to the right file.
Thanks for getting me to check for nil. I guess I've been using too
much C# and was forgetting that nil pointers are effectively ignored as
message targets.
\bob
On Dec 18, 2004, at 11:47 PM, mmalcolm crawford wrote:
On Dec 18, 2004, at 7:55 PM, Bob Peterson wrote:
Is it possible to use bindings across frameworks? I get an error:
2004-12-17 19:51:57.453 MyApp[1667] Cannot find object class with
name MyItem
It happens when I send an add: action to my NSArrayController. The
controller is declared to contain items of type MyItem. The key path
winds its way through three model objects: a MyManager, a MyItemList
controlled by the NSArrayController, and its MyItems. The MyItemList
and MyItem classes are in a separate framework from the main
application.
When I build the app as a single target (everything built into a
single executable, no separate framework), it works. What am I doing
wrong?
When you use the separate framework, can you create a new instance of
MyItem directly using alloc/init?
If so, the controller may be only looking for the class in the
application's main bundle? You could try subclassing
NSArrayController and overriding -newObject:
- newObject
{
id newObject = [[MyItem alloc] init];
// custom initialisation if required
return newObject;
}
mmalc
_______________________________________________
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