XIB 文件消失但应用程序仍然有效
我使用的是 Xcode 4.0.2,今天打开我的一个项目,发现缺少 .xib 文件(MainWindow 加载的 .xib)。我在 Finder 中看不到它,并且它根本没有出现在 Xcode 窗口中,但我的应用程序仍然可以正常工作,就好像它在那里一样。
有人知道这里可能发生了什么吗?
I'm using Xcode 4.0.2 and I opened up one of my projects today to find that a .xib file was missing (the .xib that the MainWindow loads). I can't see it in the Finder and it doesn't appear at all in the Xcode window, yet my application still works as if it's there.
Anyone have any idea what might have happened here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Cmd+Shift+K 进行清理。然后重建并重新运行。究竟是什么问题?它与 XIB 文件一起运行或者 XIB 文件去了哪里?..也许它根本不使用 XIB 文件(毕竟,它没有必要)。
Cmd+Shift+K to clean. Then rebuild and re-run. What exactly is the issue? That its running with the XIB file or where the XIB file went?.. Maybe its not using a XIB file at all (After-all, its not neccessary).
我猜你的笔尖没有任何定制工作。在您的委托中,在
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
行上,它尝试加载 ViewController.xib 文件。因为它不能,所以它与调用 self.viewController = [[ViewController alloc] initWithNibName:nil bundle:nil]; 相同,它会生成一个空白的通用视图。I'm guessing you didn't have any custom work in that nib. In your delegate on the line
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
it tries to load the ViewController.xib file. Since it can't, it's the same as callingself.viewController = [[ViewController alloc] initWithNibName:nil bundle:nil];
which produces a blank generic view.