Re: Automatically Call a Function
Re: Automatically Call a Function
- Subject: Re: Automatically Call a Function
- From: "Stephen J. Butler" <email@hidden>
- Date: Sun, 15 Jun 2008 13:29:31 -0500
On Sun, Jun 15, 2008 at 12:09 PM, Philip Lee Bridson
<email@hidden> wrote:
> I have tried to put the function in awakeFromNib but then the window wont
> close itself from that function. I have also tried putting my first window
> before the call to NSApplicationMain but then the application crashes due to
> a memory leak, I have tried using an autorelease pool and still it crashes
> when I try to initialize the window. I tried both loading the window from
> nib file and a programmed class but it just keeps crashing
Make your controller the delegate of NSApplication and handle
applicationDidFinishLaunching:. Alternately, you can set yourself up
as a listener for the NSApplicationDidFinishLaunchingNotification.
The reason your app crashes before NSApplicationMain is because you
need to call at least NSApplicationLoad. But the proper way to do what
you want is from applicationDidFinishLaunching anyway.
_______________________________________________
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