failed to update auto layout status: the agent crashed within Xcode7
来源:互联网 发布:不知道在淘宝上买什么 编辑:程序博客网 时间:2024/06/16 05:37
场景:
原先的项目使用的是swift1.2+storyboard,下载了Xcode7 GM版本,打开项目之后,首先提示的是各种语法修改,按照提示,将语法修改完之后,程序编译运行一切OK。
点击storyboard,结果环境给出了这种的错误提示(可正常编译运行),入下图所示:
ZLAttributedPlaceHolderTextField实现如下:
import UIKit@IBDesignableclass ZLAttributedPlaceHolderTextField: UITextField { @IBInspectable var placeHolderColor : UIColor = UIColor(white: 0.7, alpha: 1.0) { didSet { updateAttributedPlaceHolder() } } @IBInspectable var placeHolderFontSize : CGFloat = 14 { didSet { updateAttributedPlaceHolder() } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } func updateAttributedPlaceHolder() { if self.placeholder != nil { var attributes = [String : AnyObject]() attributes[NSForegroundColorAttributeName] = self.placeHolderColor attributes[NSFontAttributeName] = UIFont.systemFontOfSize(self.placeHolderFontSize) self.attributedPlaceholder = NSAttributedString(string: self.placeholder!, attributes: attributes) } }}
主要是想在storyboard里面就可以自由设置attributedPlaceholder
属性,而不需要再在代码里去实现。
按照错误提示,一开始是以为约束的问题,但是,检查了一下,约束并没有任何问题,随后发现如下图有这个提示:
点击DEBUG,直接断在如下所示:
不知所以然,根据图2的提示性信息,Designables Crashed,将代码里的
@IBDesignable
注释掉,OK,没有任何问题
个人理解:
该类自定义keyPath属性,内部又调用了其它方法,导致系统无法顺利执行并进行渲染。而对于一些简单的属性,例如如下的内容:
@IBDesignableextension UIView { @IBInspectable var cornerRadius : CGFloat { set { self.layer.cornerRadius = newValue } get { return self.layer.cornerRadius } } @IBInspectable var borderWidth : CGFloat { set { self.layer.borderWidth = newValue } get { return self.layer.borderWidth } } @IBInspectable var borderColor : UIColor { set { print("\(newValue)", terminator: "") self.layer.borderColor = newValue.CGColor } get { return UIColor(CGColor: self.layer.borderColor!) } }}
就不会出现上面的那种错误信息。
@IBDesignable无伤大雅,有没有,感觉都无所谓
或许个人理解有误,欢迎拍砖。至于网上说的那些
- Runpath Search Paths 添加
$(CONFIGURATION_BUILD_DIR)
- 删除 DerivedData
- Clean Project Cmd + K
- 重启Xcode
等等方法,都尝试了,然并卵
0 0
- failed to update auto layout status: the agent crashed within Xcode7
- IBDesignable Errors Failed to update auto layout status:……
- 【解决Xcode】IB Designables: Failed to update auto layout status
- failed to render and update auto layout status for....
- IB Designables: Failed to update auto layout status: Failed to load designables from path (null)(实战)
- Failed to install the VirtualCenter Agent Service
- Layout inflation is the term used within the context of Android to indicate when an XML layout resou
- Layout inflation is the term used within the context of Android to indicate when an XML layout resou
- Test run failed: Instrumentation run failed due to 'Process crashed.'
- Dubbo: Failed to check the status of the service . No provider available for the service
- Auto Layout still required after sending -viewDidLayoutSubviews to the view controller. 终极解决方法
- java.lang.IllegalStateException: Failed to check the status of the service org.cdc.system.service.S
- DUBBO 报错 Failed to check the status of the service
- Failed to check the status of the service com.taotao.search.service.SearchItemSerivce. No provider a
- Failed to read auto-increment value from the storage engine in MySQL
- Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- SharePoint Debug - Failed to load resource: the server responded with a status of 500
- Failed to load resource: the server responded with a status of 400 (Bad Request)
- 如何设计一个像人的大脑皮层一样的产品?
- java操作文件
- Oracle中Rman自动备份数据库 .
- 数据库分库分表(sharding)系列(四) 多数据源的事务处理
- 乌龟git bug
- failed to update auto layout status: the agent crashed within Xcode7
- 凭什么苹果设计师年赚110万,把设计几何学融入你的产品中
- HDU 5443 The Water Problem
- Spring MVC json问题(406 Not Acceptable) 解决办法
- MediaRecoder(查看api)录制声音
- 两个超大表做关联更新的优化 之 批量更新
- 配置浪潮服务器
- 计算图片中的物体的实际尺寸的一种方法
- MyBatis入门教程(一):快速入门