Re: problem loading a window in a new NIB using NSWindowController.
Re: problem loading a window in a new NIB using NSWindowController.
- Subject: Re: problem loading a window in a new NIB using NSWindowController.
- From: deepak gopal <email@hidden>
- Date: Sat, 6 Oct 2007 06:42:57 +0530 (IST)
I am sorry this was in the draft and I didn't realize that I hadn't sent it. :(
I found out that it was a problem with the nib I had created.
My app is loading the window now.
--------------------------------------
My application stops as soon as my control reaches [myWindowController window].
myWindowController when printed gives " <MyWindowController: 0x3c0f10>", so I guess this is good.
This is my method.
- (IBAction)downloadSymbols:(id)sender {
NSWindowController *myWindowController = [[[MyWindowController alloc]
initWithWindowNibName:@"SymbolsView"] autorelease];
NSLog (@"myWindowController %@", myWindowController );
[[myWindowController window] makeKeyAndOrderFront:self];
}
In SymbolsView.nib, I have a Window (which contains a NSTableView) and a object of class "LoadFunction" which would act as the dataSource for the TableView in the window.
I have made MyWindowController class which is a subclass of NSWindowController as the File's Owner.
The outlet "window" of File's Owner is connected to the Window and the File's Owner is made the "delegate" of the Window.
In the MainMenu.nib I have a window with a button "Grant" which is connected to the Action Class above {- (IBAction)downloadSymbols:(id)sender }.
So when I click on the button "Grant" I expect the Window to popup.
This doesn't happen.
DG
----- Original Message ----
From: Dave Hersey <email@hidden>
To: Cocoa Dev <email@hidden>
Sent: Wednesday, 3 October, 2007 5:02:52 PM
Subject: Re: problem loading a window in a new NIB using NSWindowController.
It seems likely that (at least) one of three things is happening.
Either your myWindowController is invalid, your [myWindowController
window] is invalid, or something is failing during the initialization
or waking of your controller nib.
Have you checked the values of myWindowController and
[myWindowController window] to see if they look valid?
You mentioned there's a table in the window-- are there any other
instantiated objects in the nib that might be failing/crashing?
What does the crash log say?
It's unclear from your message below if MyWindowController is an
NSWindowController subclass. If so, have you stepped through the
init, awakeFromNib and windowControllerDidLoadNib methods looking for
problems?
At what point (in which method of which class) are you executing the
code below?
You haven't provided enough information to debug this. If you go
through those first steps above, they will probably yield the answer.
If not, post the results.
- d
On Oct 3, 2007, at 2:40 PM, deepak gopal wrote:
> Hi
>
> I am trying to load a Nib File Using the code below.
> [myWindowController window] crashes the app.
>
> NSWindowController *myWindowController = [[[MyWindowController
> alloc] initWithWindowNibName:@"SymbolsView"] autorelease];
>
>
>
> [[myWindowController window] makeKeyAndOrderFront:nil];
>
> SymbolsView is the Nib name in which I have one window which has a
> tableView. I have made MyWindowController (NSWindowController)
> which is the file's owner of the NIB, as the delegate for the
> window and have connected my window to the 'window' outlet in
> MyWindowController.
>
> Am I missing something here?
>
> Thank you
> DG
_______________________________________________
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
Chat on a cool, new interface. No download required. Go to http://in.messenger.yahoo.com/webmessengerpromo.php
_______________________________________________
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