I\'m trying to follow some of the code used in the WWDC playgrounds session, I\'m trying to import the Cocoa framework with:
import Cocoa
B
If you are getting this or a similar type of error despite having the playground set properly, try the following:
Close XCode and from the terminal run:
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
Then reopen XCode and most times this fixes many Playground issues. I run this command quite frequently during an intensive Playground work session (sometimes as many as a few times per hour) and have found liberal use of removing the ModuleCache to solve a multitude of strange playground behaviors.
If you're still having issues with playgrounds you can try:
rm -rf ~/Library/Developer/Xcode/DerivedData
and/or
rm -rf ~/Library/Caches/com.apple.dt.Xcode