On Fri, Oct 17, 2008 at 5:07 PM, Samir Patel <[EMAIL PROTECTED]> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to