Re: WIndow from external framework not working
Re: WIndow from external framework not working
- Subject: Re: WIndow from external framework not working
- From: "Michael Ash" <email@hidden>
- Date: Sat, 18 Oct 2008 21:04:15 -0400
On Fri, Oct 17, 2008 at 5:07 PM, Samir Patel <email@hidden> wrote:
> I have a simple external Cocoa framework I have built that loads and displays a single nib-based window from a nib file contained in the framework. I add the framework to a separate application. Everything works fine - the window loads and appears on screen and all the outlets are valid.
>
> But when I try to click a button in the window, nothing happens, and none of my actions get sent. The application that the window is added to/created from also starts to exhibit weird behavior, becoming intermittently unresponsive and having other things in the app itself stop working.
>
> What am I missing? Is there something I need to do to the window after creating it to make it interoperate correctly with the main application?
First, forget about "from external framework". Code cannot know what
is calling it*. Code that works in an application will also work in a
framework. It is possible that you're directing Cocoa to look for
resources in the wrong place (the resources are in the framework but
you implicitly told it to search the application, for example), but
that's not quite the same.
Your symptoms sound a lot like what happens when there's an uncaught
exception. All sorts of stuff gets screwed up if you throw an
exception through code that doesn't expect it, which can leave the
framework in an inconsistent state. Does anything show up in your run
log or debugger log?
* Technically it is possible to find out whether a method or function
was called from application or framework code, and even which
framework. But it's unorthodox and evil, and rare to the point that
I've never even heard of anyone besides myself doing it.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden