You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 9.2中旧项目Storyboard的ViewController加载异常求助

Fixing Storyboard ViewController Display Issues in Xcode 9.2

Hey there, let's work through this annoying Storyboard problem together—those tiny blue squares showing up instead of your actual ViewControllers are such a headache, especially with an older 3-year-old project in Xcode 9.2. Here are some practical, tested fixes to get your Storyboard rendering normally again:

  • Clean project cache & Derived Data
    Start with the basics, as corrupted build artifacts often cause these glitches:

    1. Go to Xcode's top menu > Product > Clean (or use the shortcut Cmd+Shift+K).
    2. Delete your project's Derived Data: Open Xcode > Preferences > Locations, click the arrow next to the Derived Data path to open the folder. Find your project's folder, delete it, then restart Xcode.
  • Verify Storyboard document settings
    Select your Storyboard file, then check the right-hand Inspector panel:

    • In the Interface Builder Document section, make sure Builds for is set to a version compatible with Xcode 9.2 (like your original project's target iOS version, e.g., iOS 8.0+). Avoid newer iOS versions that Xcode 9.2 doesn't fully support.
    • Double-check the View as dropdown—sometimes selecting an unsupported device or size class can cause ViewControllers to render incorrectly as small squares.
  • Inspect & repair the Storyboard's source code
    Corrupted XML in the Storyboard file is a common culprit:

    1. Right-click your Storyboard > Open As > Source Code.
    2. Look for red error markers, missing tags (like <viewController>), or malformed XML. If you have a backup of your working project, compare the source code and replace any damaged sections.
    3. If you can't pinpoint the issue, delete the problematic ViewController node from the source code, save the file, then re-open it as a Storyboard. You can then drag a new ViewController into the canvas and re-link your code and outlets.
  • Reset Xcode's interface preferences
    Sometimes Xcode's cached UI layout causes display bugs. Close Xcode completely, then open Terminal and run this command:

    defaults delete com.apple.dt.Xcode
    

    Restart Xcode afterward. Note: This resets all Xcode preferences (theme, shortcuts, etc.), so back up custom settings if needed.

  • Check dependencies & class associations
    If your ViewController uses custom classes or third-party frameworks:

    • Go to your project's Build Phases > Linked Frameworks and Libraries—make sure there are no red missing items. Re-add any missing frameworks if needed.
    • Confirm that the class name in your ViewController file matches exactly what's set in the Storyboard's Identity Inspector (Xcode 9.2 is case-sensitive, so even a capitalization mismatch can break rendering).

Give these steps a try in order—most of the time, cleaning Derived Data or fixing the Storyboard source code resolves this issue. If all else fails, try creating a new empty project in Xcode 9.2, then import your Storyboard and ViewController files to rule out project-wide configuration problems.

内容的提问来源于stack exchange,提问作者Shekhu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:46:38