Xcode 6.0.1,Swift,UIKit,CoreGraphics缺失 [英] Xcode 6.0.1, Swift, UIKit, CoreGraphics missing

查看:62
本文介绍了Xcode 6.0.1,Swift,UIKit,CoreGraphics缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之:

永远不要给项目一个框架名称!我称我的项目为 CoreGraphics。

Do never ever give a project a frameworks name! I called my project "CoreGraphics".

原始问题:

我不能在新创建的简单单视图应用程序中使用CoreGraphics

I cant use CoreGraphics in a newly created simple Single View Application


  • 我启动 Xcode 6.0.1 (6A317)

  • 新项目:单视图应用程序:Swift

  • 新文件:类型为<$ c $的可可接触类 CustomView c> UIView

  • 我取消注释 drawRect(rect:CGRect){}
  • I start Xcode 6.0.1 (6A317)
  • New Project: Single View Application: Swift
  • New File: Cocoa Touch Class "CustomView" of type UIView
  • I uncomment the template for drawRect(rect: CGRect) {}

编译器错误:使用未声明的类型'CGRect'。


  • 导入UIKit 到位

  • 我试图将CoreGraphics添加到链接的框架和库中

  • 我已经重新启动了Xcode(和Mac)

  • import UIKit is in place
  • I tried to add CoreGraphics to "Linked Frameworks and Libraries"
  • I already restarted Xcode (and my Mac)

更新


  • 我安装了 Xcode 6.1 (6A1046a),并重新创建了我的简单项目。

  • I installed Xcode 6.1 (6A1046a) opened and recreated my simple project.

相同是起诉:编译器错误:使用未声明的类型'CGRect'。

Same issue: Compiler Error: Use of undeclared type 'CGRect'.

还有其他建议吗?

推荐答案

不要将您的项目命名为 CoreGraphics

Don't name your Project "CoreGraphics"

这篇关于Xcode 6.0.1,Swift,UIKit,CoreGraphics缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆