Unable to use iOS framework which is internally using .xib file

前端 未结 8 2254
你的背包
你的背包 2020-12-16 19:14

I am trying to make a universal framework, for iOS by following steps specified in this URL: Universal-framework-iOS

I have a viewController class within, that frame

8条回答
  •  既然无缘
    2020-12-16 19:20

    You need to specify the bundle to search inside for the nib. Otherwise, it just (shallowly) searches your application's resources directory.

    - (id)initWithTitle:(NSString *)aTitle
    {
        // replace 'framework' with 'bundle' for a static resources bundle 
        NSURL *frameworkURL = [[NSBundle mainBundle] URLForResource:@"myFrameworkName" withExtension:@"framework"];
        NSBundle *framework = [NSBundle bundleWithURL:frameworkURL];
    
        self = [super initWithNibName:@"ViewControllerWithinFramework" bundle:framework];
        if (self)
        {
           _viewControllerTitle = aTitle;
        }
    
        return self;
    }
    

提交回复
热议问题