Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make UKNibOwner work with classes in frameworks/plug-ins as well

We fall back on the main bundle if our bundle doesn't contain the requested NIB file.
  • Loading branch information...
commit aad4c7f935cd6820abc5e3e125c8ef83ce4a4575 1 parent 88737da
@uliwitness authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 UKNibOwner.m
View
8 UKNibOwner.m
@@ -64,11 +64,17 @@ -(id) initWithNibName: (NSString*)nibName owner: (id)owner
owner, @"NSOwner",
topLevelObjects, @"NSTopLevelObjects",
nil];
- NSBundle* mainB = [NSBundle mainBundle];
+ NSBundle* mainB = [NSBundle bundleForClass: [self class]];
if( nibName )
[mainB loadNibFile: nibName externalNameTable: ent withZone: [self zone]]; // We're responsible for releasing the top-level objects in the NIB (our view, right now).
if( nibName && [topLevelObjects count] == 0 )
{
+ mainB = [NSBundle mainBundle];
+ if( nibName )
+ [mainB loadNibFile: nibName externalNameTable: ent withZone: [self zone]]; // We're responsible for releasing the top-level objects in the NIB (our view, right now).
+ }
+ if( nibName && [topLevelObjects count] == 0 )
+ {
NSLog(@"%@: Couldn't find NIB file \"%@.nib\".", NSStringFromClass([self class]), nibName);
[self autorelease];
return nil;
Please sign in to comment.
Something went wrong with that request. Please try again.