私はカスタムフレームワークを行い、このリソースをtutorialでバンドルします。IBOutletまたはIBActionに接続したときに、私のストーリーボードがカスタムバンドルリソースから機能しないのはなぜですか?
バンドルリソースにはストーリーボード(内部のViewController)とイメージがあります。
私がIBOutlet
またはIBAction
を接続すると、ViewController
が表示されてクラッシュします。 UI
オブジェクトの接続がすべて正常であると確信しています。
xibを使用しようとしましたが、それは完全に機能しました。ここで
エラーログ:
Unknown class TestViewController in Interface Builder file.
ここで私は、バンドルのリソースのstroyboardからのViewController提示のコードは次のとおりです。
* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key goButton.' * First throw call stack: (0x244a391b 0x23c3ee17 0x244a3629 0x24c171f3 0x28d828b7 0x24c296d3 0x28ed3e9b 0x243ed1cb 0x28ed2bd1 0x28d85aa3 0x28b58ffb 0x28a1ea1f 0x28a1e971 0x292b3ec1 0x28d6ad01 0x28d8e6e5 0x28d90d25 0x28d90f91 0x28b17db9 0xd0b5 0x28a3714b 0x28aa7193 0x28aa7129 0x28cc75b1 0x28cd37db 0x24465d21 0x244657dd 0x24463d51 0x243b3229 0x243b3015 0x259a3ac9 0x28a87189 0xd2ed 0x2405b873) libc++abi.dylib: terminating with uncaught exception of type NSException
エラーの前に警告があります。この文から
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"XXXSDK" ofType:@"bundle"];
NSBundle *resourcesBundle = [NSBundle bundleWithPath:bundlePath];
UIStoryboard *resourcesStoryboard = [UIStoryboard storyboardWithName:@"Resources" bundle:resourcesBundle];
TestViewController *testVC = [resourcesStoryboard instantiateViewControllerWithIdentifier:@"TestViewController"];
[self presentViewController:testVC animated:YES completion:nil];
1. TestViewController.hと.mがフレームワークにパッケージされていることを確信しています。 – ovo
お返事ありがとうございます – ovo
解決方法を試すことができますhttp://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime/1725893#1725893 –