Re: Weird bug in my code [long]
Re: Weird bug in my code [long]
- Subject: Re: Weird bug in my code [long]
- From: p3consulting <email@hidden>
- Date: Sun, 22 Feb 2004 23:01:43 +0100
On 22 fivr. 2004, at 11:40, Robert Cerny wrote:
Hi folks,
I have got a pretty weird bug in my code, which I'm unable to find.
The situation is as follows: I have a window, which is loaded from
another nib than MainMenu.nib The Nib owner of my object is
FMDelegate. The window contains a NSOutlineView, which should display
all font families active in system.
The bug is that sometimes the outline displays empty. I used a few
dozens of NSAsserts to find the problematic place but didn't find
anything. I added a button to window, which is used just for invoking
debuger and using this technique I was able to stop in problematic
case. (the problem doesn't show always) To my suprise, the pointers to
window objects - created in IB - were empty!? It leads me to idea that
I somehow harm the initialization process but I have no idea what's
wrong. Let me show you some code:
A common problem that generates that kind of symptom is multiple
instance of an IB object:
log your init methods and check that you don't have two copies of yours
controller, delegate, etc.
- (IBAction)showFontList:(id)sender
{
if (!fontListController)
{
[NSBundle loadNibNamed:@"FontList" owner:self];
}
[fontListController showWindow:[fontListController window]];
}
where do you set fontListController to its value avec loading from the
nib ?
Pascal Pochet
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.