Using nib Files in iOS Modules
I have a subclass of the UIViewController class that needs to be initialized with a nib file. Where do I put the .xib file in the xcode project? Currently, I am using the 'assets' folder that was generated but I keep getting this Exception:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/carlo/Library/Application Support/iPhone Simulator/4.3/Applications/F9738EC6-793A-4334-B143-67ADACFB41DA/iosmymodule.app> (loaded)' with name 'MyView''
Also, if my ViewController's xib file needs to use images from the resource folder, where must their files be located in the xcode project? Should they also be located in the assets folder?
xCode version is 3.2.6 and titanium mobile sdk version 1.7.2.
3 Answers
-
Accepted Answer
What I noticed in the application resource package is that 'MyView' was not converted into a nib file. It remained to be xib even when the module was built. What I did, is to make the nib file first and put it in the Titanium project '/Resources/iphone/' folder - this way, it goes to the root folder in the application package and this fixed my problem. :-)
-
Try this… Go to the properties of the .xib files in the file inspector, set the property 'Location' to 'Relative to project'.
Let me know if that works.
-
Hi,
Can you please explain how you created the nib file and how you connected it to your class in a titanium module?
Thank