Tôi đang cố gắng để thay thế cho phảncố gắng thay thế phản loadnibnamed: chủ sở hữu
[NSBundle loadNibNamed:@"Subscriptions" owner:self];
với điều này để thay thế (chỉ điều tôi có thể tìm thấy đó là tương đương)
[[NSBundle mainBundle] loadNibNamed:@"Subscriptions" owner:self topLevelObjects:nil];
nhưng hộp thoại bật lên và biến mất ngay lập tức thay vì ở lại mở như nó đã làm với các cuộc gọi không được chấp nhận.
Mã này nằm trong bộ điều khiển chế độ xem như thế này.
- (id)init{
self = [super init];
if (self) {
//[NSBundle loadNibNamed:@"Subscriptions" owner:self];
[[NSBundle mainBundle] loadNibNamed:@"Subscriptions" owner:self topLevelObjects:nil];
}
return self;
}
và tôi gọi nó từ appdelegate như thế này.
SubscriptionsViewController *subscriptionsViewController = [[SubscriptionsViewController alloc] init];
[subscriptionsViewController.window makeKeyAndOrderFront:self];
Tôi còn thiếu điều gì không? Nó có vẻ thẳng về phía tôi.
Tôi cũng có cùng một vấn đề, bạn đã tìm thấy bất kỳ giải pháp – Retro