Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?

2009-07-21 Thread Michael A. Crawford
We have a winner!  Yeah, both NSWindow outlets were not hooked up in  
IB.  Shouldn't I get some sort of warning.  Oh well.  Thanks for  
pointing that out.  The views don't look right but they show up.  I  
will sort it from here.


-Michael

On Jul 21, 2009, at 12:42 AM, Kyle Sluder wrote:

On Jul 20, 2009, at 9:28 PM, Michael A. Crawford michaelacrawf...@mac.com 
 wrote:


The NIB file is loaded in that I was able set a breakpoint on - 
[awakeFromNib] for the NDView class.  Yet, I don't see any output.   
If I remove the controller and use IB to add the NDView to the  
window as a custom-view.  I can see the view and works fine.  I've  
tried both the -[setContent] -[addSubview] calls.


You're in the debugger; that's an important first step. But you need  
to verify that your window outlet isn't nil (as well as the view  
controller's view). If all else fails, remember that you can  
evaluate expressions and invoke arbitrary statements in the gdb  
console.


--Kyle Sluder




smime.p7s
Description: S/MIME cryptographic signature
___

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 arch...@mail-archive.com

Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?

2009-07-21 Thread Bill Bumgarner

On Jul 21, 2009, at 8:13 AM, Michael A. Crawford wrote:

We have a winner!  Yeah, both NSWindow outlets were not hooked up in  
IB.  Shouldn't I get some sort of warning.  Oh well.  Thanks for  
pointing that out.  The views don't look right but they show up.  I  
will sort it from here.


File a bug on that, please

http://bugreport.apple.com/

... it might be returned as a dupe, but dupes are votes and, coupled  
with the narrative on cocoa-dev, will capture another compelling case  
for this particular validation.


b.bum

___

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 arch...@mail-archive.com


What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?

2009-07-20 Thread Michael A. Crawford

I've tried the following but I get no output (the view is blank).

- (void)awakeFromNib
{
	ndViewController = [[NDViewController alloc]  
initWithNibName:@NDView bundle:nil];

#if 1
[window.contentView addSubview:ndViewController.view];
#else
[window setContentView:ndViewController.view];
#endif
}

The NIB file is loaded in that I was able set a breakpoint on - 
[awakeFromNib] for the NDView class.  Yet, I don't see any output.  If  
I remove the controller and use IB to add the NDView to the window as  
a custom-view.  I can see the view and works fine.  I've tried both  
the -[setContent] -[addSubview] calls.


Perhaps someone can point to a sample or has a check-list of steps to  
take when manually loading views from nibs and attaching them to  
existing windows?


Thanks.

-Michael



smime.p7s
Description: S/MIME cryptographic signature
___

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 arch...@mail-archive.com

Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?

2009-07-20 Thread Kyle Sluder
On Jul 20, 2009, at 9:28 PM, Michael A. Crawford michaelacrawf...@mac.com 
 wrote:


The NIB file is loaded in that I was able set a breakpoint on - 
[awakeFromNib] for the NDView class.  Yet, I don't see any output.   
If I remove the controller and use IB to add the NDView to the  
window as a custom-view.  I can see the view and works fine.  I've  
tried both the -[setContent] -[addSubview] calls.


You're in the debugger; that's an important first step. But you need  
to verify that your window outlet isn't nil (as well as the view  
controller's view). If all else fails, remember that you can evaluate  
expressions and invoke arbitrary statements in the gdb console.


--Kyle Sluder
___

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 arch...@mail-archive.com


Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?

2009-07-20 Thread Quincey Morris

On Jul 20, 2009, at 21:28, Michael A. Crawford wrote:


I've tried the following but I get no output (the view is blank).

- (void)awakeFromNib
{
	ndViewController = [[NDViewController alloc]  
initWithNibName:@NDView bundle:nil];

#if 1
[window.contentView addSubview:ndViewController.view];
#else
[window setContentView:ndViewController.view];
#endif
}

The NIB file is loaded in that I was able set a breakpoint on - 
[awakeFromNib] for the NDView class.  Yet, I don't see any output.   
If I remove the controller and use IB to add the NDView to the  
window as a custom-view.  I can see the view and works fine.  I've  
tried both the -[setContent] -[addSubview] calls.


Perhaps someone can point to a sample or has a check-list of steps  
to take when manually loading views from nibs and attaching them to  
existing windows?


The thing I always forget is to connect the File's Owner 'view' outlet  
to the view in the nib file.



___

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 arch...@mail-archive.com