我正在尝试通过遵循此URL中指定的步骤为iOS创建通用框架:Universal-framework-iOS
我有一个viewController类,该框架内部加载.xib文件.
下面是代码的一部分,它显示了我如何初始化viewController并显示相关视图:
/*** Part of implementation of SomeViewController class, which is outside the framework ***/
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.viewControllerWithinFramework = [[ViewControllerWithinFramework alloc] initWithTitle:@"My custom view"];
}
- (IBAction)showSomeView:(id)sender {
[self.viewControllerWithinFramework showRelatedView];
}
/*** Part of implementation of ViewControllerWithinFramework class, which is inside the framework ***/
- (id)initWithTitle:(NSString *)aTitle
{
self = [super initWithNibName:@"ViewControllerWithinFramework" bundle:nil]; // ViewControllerWithinFramework.xib is within the framework
if (self)
{ …Run Code Online (Sandbox Code Playgroud)