1

I'm developing my first iPhone app.

One day, I renamed some files including xib file and its view controller.
After that, my app began to use old xib file.

I deleted xib file, but the old xib still was used.
The code to init view controller was:

MyViewController *vc = [[MyViewController alloc] init];

I modified the code to:

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];

Then my app used the new xib instead of the old xib.

The question is, is it possible that old xib files are displayed not only on developing apps but also on released apps for some reasons?

Can I avoid old nix caching on released apps if I use initWithNibName: instead of init?

js_
  • 4,671
  • 6
  • 44
  • 61

2 Answers2

0

In Product->Clean and then after Execute this will be solve your problem.

Dipen Chudasama
  • 3,063
  • 21
  • 42
0

I think you need to remove the files in DerivedData. I've been through this sort of thing. If you're using the Simulator, I'd also reset the simulator or delete its files.

Paths:

/Users/yourname/Library/Developer/Xcode/DerivedData

/Users/yourname/Library/Application Support/iPhone Simulator

You could get fussy, but I usually delete the DerivedData directory when I am having trouble. Xcode will rebuild them in less time that it takes to worry about the problem. In the iPhoneSimulator, you can find your app fairly easily and delete that directory if you choose.

Bruce Cichowlas
  • 336
  • 1
  • 7