I am creating a static library in iOS. I am using a storyboard file in it. In order to do so I have created a resource bundle file named OfferWallResources.bundle
in which I have added my storyboard file named Offerwall.storyboard
. I have a UIViewController
with identifier OfferWallViewController
in the storyboard: When I try to instantiate it inside the static library, I get the following error message:
Unknown class OfferwallViewController
in Interface Builder file
The code for instantiating the UIViewController
is as follows:
NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"OfferWallResources" withExtension:@"bundle"]];
UIStoryboard *s=[UIStoryboard storyboardWithName:@"Offerwall" bundle:bundle];
OfferwallViewController *o=[s instantiateViewControllerWithIdentifier:@"OfferwallViewController"];
I also made OfferwallViewController
the initial UIViewController
of the storyboard and tried using the following code:
OfferwallViewController *o=[s instantiateInitialViewController];
But, I am still facing the same issue when I am instantiating the UIViewController
inside the static library.
I tried following the link: Xcode 6 Strange Bug: Unknown class in Interface Builder file But nothing happens when I press Enter inside the Module option of the given viewcontroller.
I am still not getting where I am going wrong. I am using Xcode 7.2.