I'm trying to replace the deprecated
[NSBundle loadNibNamed:@"Subscriptions" owner:self];
with this instead (only thing I can find that's equivalent)
[[NSBundle mainBundle] loadNibNamed:@"Subscriptions" owner:self topLevelObjects:nil];
but the dialog pops up and disappears right away instead of staying open like it was doing with the deprecated call.
This code is inside a viewcontroller like this.
- (id)init{
self = [super init];
if (self) {
//[NSBundle loadNibNamed:@"Subscriptions" owner:self];
[[NSBundle mainBundle] loadNibNamed:@"Subscriptions" owner:self topLevelObjects:nil];
}
return self;
}
and I'm calling it from the appdelegate like this.
SubscriptionsViewController *subscriptionsViewController = [[SubscriptionsViewController alloc] init];
[subscriptionsViewController.window makeKeyAndOrderFront:self];
Is there anything I'm missing? It seems straight forward to me.