Reputation: 349
Currently I've been loading nibs programmatically in my app using [NSBundle mainBundle] loadNibNamed:
. All I want to do is just contain all my nibs in a subfolder (and their referenced images), but it seems near impossible to load these. loadNibNamed doesn't allow a path to be specified. I've done a ton of searching and can't find any suitable way. Everything else I've tried gives an exception.
I've tried loading the data from file and unarchiving it, but it says it's an incomprehensible archive.
UINib
has the same problem as NSBundle
.
There has to be a way to specify the file path, just like loading any other file.
I want the final contents to be an NSArray
just like loadNibNamed:
returned.
Any insight would be helpful.
The closest I got was using [NSBundle bundleWithPath:]
and specifiying the fullpath. It says the path is not yet loaded, and throws and exception. Why is it not loaded?
Upvotes: 0
Views: 719
Reputation: 2360
I think you are getting "not yet loaded" because you are not loading the bundle [bundle load]. Also check for Name case-sensitivity because simulator is generally case-insensitive and Device is not. Try this and see how you go.
Regards, Ravi
Upvotes: 2