Xcode 9.2中Storyboard内容间歇性空白问题求助
Hey there, sorry to hear you're stuck with this frustrating Storyboard glitch—nothing's worse than having your views vanish out of nowhere when you need to work on them! Let's walk through some tried-and-true solutions to get your Storyboard displaying correctly again:
Clean your project and delete Derived Data
Start with the basics: Go toProduct > Cleanin the Xcode menu to clean your project. Then clear out the Derived Data folder (Xcode stores temporary build files here that often cause weird rendering issues). You can find it at~/Library/Developer/Xcode/DerivedData, or open Xcode'sPreferences > Locationsand click the arrow next to "Derived Data" to open the folder, then delete everything inside. Restart Xcode after this step.Reset Xcode's preference cache
Corrupted user preferences can mess with the Storyboard renderer. Quit Xcode completely, then open Terminal and run this command:defaults delete com.apple.dt.XcodeNote: This will reset Xcode to its default settings, so you'll need to reconfigure any custom preferences later—but it often fixes stubborn UI bugs.
Check for Storyboard file corruption
Right-click your problematic Storyboard file and selectOpen As > Source Code. Look for red error indicators or malformed XML tags (like unclosed elements). If you spot issues, try restoring a previous working version from your version control (like Git), or manually fix small XML errors. If you're unsure, create a new Storyboard file and copy your view controllers over—this can bypass hidden corruption in the original file.Upgrade to the latest compatible Xcode version
Xcode 9.2 had a few known Storyboard rendering bugs. If your project allows, try upgrading to Xcode 9.4.1 (the final release of the Xcode 9 series)—it includes bug fixes that might resolve this blank view issue.Verify view controller connections and constraints
Open the Document Outline panel (left side of the Storyboard editor) to confirm all your views are still listed under the view controller. Look for yellow exclamation marks that signal constraint issues or broken connections. You can also try adding a simple test label or view to the controller—if it shows up, the problem might be specific to certain views in your controller, not the Storyboard itself.
If none of these solutions work, consider submitting a bug report to Apple with your screenshot and detailed steps to reproduce the issue—they can help diagnose deeper problems with the Xcode Storyboard engine.
内容的提问来源于stack exchange,提问作者Ankush_ios_2017

