0

I've adapted my iOS 6(with autolayout) app for iOS 5 too. I had to create 2 xibs, and load each one of them depending on the iOS version. Like its explained here,

I also localized the iOS 6 xibs, and it switches to the language (spanish and english) perfectly but the iOS 5 version doesnt. The iOS 5 xibs I added them afterwards I created all the ViewControllers, so maybe it's not correctly linked. Im not sure how the iOS decides with version(spanish or english) of the xib to load.

I tried this to initialize my view controllers, but the images in the XIB are not loaded, also I would like it to be as automatic as with iOS 6, using this I would have to check the language and set the pathForResource

NSString* path= [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"];

NSBundle* languageBundle = [NSBundle bundleWithPath:path];
self = [super initWithNibName:nibNameOrNil bundle:languageBundle];

Any ideas?

Thanks.

Community
  • 1
  • 1
subharb
  • 3,374
  • 8
  • 41
  • 72
  • check out http://stackoverflow.com/questions/8712049/manually-loading-a-different-localized-nib-in-ios?rq=1 – parilogic Mar 07 '13 at 13:51
  • when I try that the images dont load. The textfields and rest of elements are there but the background images are missing. It has to do something with the bundle, but I dont quite understand it and I dont know how to fix it. – subharb Mar 07 '13 at 18:22

1 Answers1

0

I figure out what was wrong. The XIB files for iOS 5 were located in a different folder as what the iOS 6 files where, so when I was loading the bundle for that XIB the images that I needed weren't reachable. So I changed where the XIB files where and it worked!

subharb
  • 3,374
  • 8
  • 41
  • 72