Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle

本文解决了一个iOS应用中由于Storyboard文件命名不规范导致的问题。通过重命名Storyboard文件并修改Info.plist文件中的相关配置,最终成功解决了应用无法识别Storyboard文件的问题。文章详细介绍了操作步骤和解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The simulator is not case sensitive, but the device is. If your storyboard is called MainStoryboard, not MainStoryBoard, this will cause your problem.

I have fixed this issue by following below steps:

  1. Renaming "MainStoryboard.storyboard" to "MainStoryboard_1.storyboard"
  2. Open file "$your_app$-Info.plist" located in "Supporting Files" folder. Edit "Main storyboard file base name" to "MainStoryboard_1.storyboard".
  3. Rerun the app, and it worked for me.
  4. I renamed my storyboard file back to its original "MainStoryboard.storyboard".
  5. Edited the .plist file back to its original.
  6. Rerun the app, and it worked for me.
For some reason the file "MainStoryboard.storyboard" was not recognised after force quitting Xcode and following above steps made the app recognise the file back again.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值