"AuthenticationViewController.xib" nibiyle "AuthenticationViewController.h" adında bir denetleyici denetleyicisi olan bir çerçeve hazırladım. Ve test edilecek örnek bir proje, AuthenticationViewController'ı sunmak için kullanıldı. Objective-C
yılında: benim için çalışıyorBir görünüm denetleyicisini hızlı bir dış çerçeveden nasıl sunabilirsiniz?
NSString *frameworkDirPath = [[NSBundle mainBundle] privateFrameworksPath];
NSString *frameworkBundlePath = [frameworkDirPath stringByAppendingPathComponent:@"SendOTPFramework.framework"];
NSBundle *frameworkBundle = [NSBundle bundleWithPath:frameworkBundlePath];
AuthenticationViewController *authenticationViewController = [[AuthenticationViewController alloc]initWithNibName:@"AuthenticationViewController" bundle:frameworkBundle];
authenticationViewController.delegate = self;
[self presentViewController:authenticationViewController animated:YES completion:nil];
. ?
let frameworkBundle = NSBundle(identifier: "SendOTPFramework")
let authViewControler :AuthenticationViewController = AuthenticationViewController.init(nibName: "AuthenticationViewController", bundle: frameworkBundle)
authViewControler.delegate = self
self.presentViewController(authViewControler, animated: true, completion: nil)
uygulama çöker hata ile: Ben Swift
aşağıdaki kodu kullandığınızda
Ama? -
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'AuthenticationViewController''
"Tanımlayıcı", projede yer alan çerçevenin paket tanımlayıcısıdır. Veya çerçeve adı dahil. –
@HussainChhatriwala Çerçevenin paket tanımlayıcısı. Yol işlevini hızlıca da kullanabilirsiniz. – Lumialxk
Yukarıda çalışan denetleyiciyi çalıştırabilir. Ancak uygulama uygulaması herhangi bir kilitlenme kaydı olmadan uygulama temsilcisi üzerinde birkaç saniye sonra çöküyor. –