Index: Source/NSViewController.m =================================================================== --- Source/NSViewController.m (revision 32865) +++ Source/NSViewController.m (working copy) @@ -25,9 +25,12 @@ Boston, MA 02110-1301, USA. */ +#import #import +#import #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSNib.h" +#import "AppKit/NSNibLoading.h" #import "AppKit/NSViewController.h" @@ -96,30 +99,34 @@ - (void)loadView { - NSNib *nib; + NSDictionary *table; + NSString *nibPath; if (_vcFlags.nib_is_loaded) { return; } - nib = [[NSNib alloc] initWithNibNamed: [self nibName] - bundle: [self nibBundle]]; - if ((nib != nil) && [nib instantiateNibWithOwner: self - topLevelObjects: &_topLevelObjects]) + nibPath = [[NSBundle mainBundle] pathForNibResource: _nibName]; + + table = [NSDictionary dictionaryWithObject: self forKey: NSNibOwner]; + if ([NSBundle loadNibFile: nibPath + externalNameTable: table + withZone: [self zone]]) { + // success! _vcFlags.nib_is_loaded = YES; - // FIXME: Need to resolve possible retain cycles here + // FIXME: Do we need to resolve possible retain cycles here? } else { if (_nibName != nil) { - NSLog(@"%@: could not load nib named %@.nib", + NSLog(@"%@: could not load nib named %@.nib", [self class], _nibName); } } - RELEASE(nib); + } - (NSString *)nibName Index: Headers/AppKit/NSViewController.h =================================================================== --- Headers/AppKit/NSViewController.h (revision 32865) +++ Headers/AppKit/NSViewController.h (working copy) @@ -68,6 +68,8 @@ - (NSString *)nibName; - (NSBundle *)nibBundle; +- (void)loadView; + @end #endif // OS_API_VERSION