Open omarojo opened 12 years ago
It should include the resources in the default bundle, so you can just use nil.
Hows that ?? I think the .xib file is in the Bundle. check out the screenshot Screenshot My Framework: https://www.box.com/s/dfb9e3cdec2d810c130b
Where is the default bundle ?
TestViewController.nib is inside the "Resources" directory in MesquiteFW.embeddedframework.
Xcode sees TestViewController.nib as it sees any other resource, and places it at the top level of the "default" bundle, also known as the main bundle or application bundle. See here: https://developer.apple.com/library/mac/#documentation/CoreFOundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13
This means that you load it exactly the same way as you'd load it if it were created inside your app project:
[[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil]
So that means I have things well configured. well "bundle:nil" isnt working.
I get "signal SIGABRT" error https://www.box.com/s/e7a66d83d3f9f478d817
Thats why I asked.. cause I dont know why isnt working.
I've created an example framework and app project to demonstrate here: https://github.com/kstenerud/iOS-Universal-Framework/tree/examples/nib-in-framework
I see.. your project works well. But I cant replicate it. I drag and drop my MesquiteFW.embeddedframework to my project. But resources dont get to top level.
This was the only way I could load the view.
NSString settingsPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"MesquiteFW.embeddedframework"]; NSBundle mibundle = [[NSBundle alloc] initWithPath:settingsPath];
TestViewController *nuevaVista = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:mibundle]; self.window.rootViewController = nuevaVista;
but Thanks anyways.
Make sure when you copy your framework in that you have the following selected:
Thank you very much ! it worked out... have a coffee. :)
Im having trouble how to load a View that is made in my framework and loaded in my app.
using the initwithNibName: bundle:
What should I put in bundle ?? how would it be to access images or other kind os resource ?
Screenshot My app: https://www.box.com/s/5a018452be0f7a2c10af
Screenshot My Framework: https://www.box.com/s/dfb9e3cdec2d810c130b