I have a UIView and I'm trying to set its layer properties.

self.colorSwatch = [[UIView alloc] initWithFrame:CGRectMake(, , , )];
self.colorSwatch.layer.cornerRadius = ;

However, when I try to access the .layer.cornerRadius property, I get a warning that says "Property 'cornerRadius' cannot be found in forward class object 'CALayer *'.

What does this mean? Thanks

It doesn't know what type of object the layer property is. Add #import <QuartzCore/QuartzCore.h> to the top of your file.

You also need to add the QuartzCore framework if you didn't do that already.

Property cannot be found on forward class object?的更多相关文章

  1. UITableViewCell Property “icon” cannot be found in forward class object “DJWeiBo”

    UITableViewCell 自定义表格 实体属性不显示错误 Property “icon” cannot be found in forward class object “DJWeiBo”引入实 ...

  2. JavaScript—从数组的indexOf方法深入——Object的Property机制。

    在js中,可以说万物皆对象(object),一个数组也是一个对象(array). 很多对象都有很多很方便的方法 比如数组的push,concat,slice等等,但是如果一些对象,它没有实现这些方法, ...

  3. TypeScript 错误property does not exist on type Object

    TypeScript 错误property does not exist on type Object 在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'val ...

  4. history对象 back() forward() go() 和pushState() replaceState()

    History(Window.history对象)对象保存着用户上网的历史记录.处于安全方面的考虑,开发人员无法得知用户浏览过的URL,但是借由用户访问过的页面列表,同样可以在不知道实际URL的情况下 ...

  5. JsonHelper developed by using Newtonsoft.Json.NET, Deserialize to <T> object , XmlToJson/JsonToXml, QuoteName by using JToken Path.

    namespace TestConsoleApplication { using System; using System.Diagnostics; using System.Threading; u ...

  6. python装饰器--@property

    @property 考察 Student 类: class Student(object): def __init__(self, name, score): self.name = name sel ...

  7. property中的strong 、weak、copy 、assign 、retain 、unsafe_unretained 与autoreleasing区别和作用详解

    iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存.但是学习还是很有必要的. 在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都 ...

  8. Controlling z-order using the ZIndex Property

      The Composing a XAML Clip Art Scene posting showed how you could layer multiple drawing objects in ...

  9. Attribute 与 Property 的区别

    网上的说法是: Property 是面向对象的概念,是Object的一部分. Attribute 是<input type="text"> type就是Attribut ...

随机推荐

  1. iOS开发之loadView、viewDidLoad及viewDidUnload的关系

    iOS开发之loadView.viewDidLoad及viewDidUnload的关系 iOS开发之loadView.viewDidLoad及viewDidUnload的关系    标题中所说的3个方 ...

  2. Android:android:gravity 和 android:layout_Gravity 的区别

    LinearLayout有两个非常相似的属性:android:gravity与android:layout_gravity. android:gravity 属性是对该view中内容的限定 andro ...

  3. 2014年最火的 21个JavaScript 框架

    下面,我们将会介绍 2014 年最火的 21 款JavaScript 框架,专为前端开发者准备的哦:)众所周知, JavaScript 框架是 JavaScript编程语言最棒的特性之一. JavaS ...

  4. Where is Vasya?

    Where is Vasya? Vasya stands in line with number of people p (including Vasya), but he doesn't know ...

  5. spring + mybatis 注解式事务不回滚的原因分析 @Transactional

    在一个项目中发现spring的事务无法回滚. DEBUG: org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.ses ...

  6. 创业实战go语言制作网站(转)

    简单介绍一下之前的整个职业生涯,挺典型的,工程师 –> 资深工程师 –> 架构师 –> 项目经理 –> 部门经理,可以说,产品研发过程中的所有角色我都走了一遍,任职的公司也越来 ...

  7. Js动态传递不定数目的参数

    回调程序中,经常有这样的需求:用户传递一个回调方法,该方法可以有不定的参数. 如果参数数目固定则很容易实现,看代码: //回调函数1 function callback1(a,b,c) { alert ...

  8. 移植mysql到嵌入式ARM平台

    移植MySQL到嵌入式ARM平台  MySQL没有专门针对ARM的版本,移植到ARM没有官方文档可参考,因此,暂时参考这样一篇文档: http://blog.chinaunix.net/space.p ...

  9. e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (四) Q 反回调

    上一篇文章“e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (三) SqlServ ...

  10. js中的继承2--原型继承

    一. 原型与构造函数 Js所有的函数都有一个prototype属性,这个属性引用了一个对象,即原型对象,也简称原型.这个函数包括构造函数和普通函数,我们讲的更多是构造函数的原型,但是也不能否定普通函数 ...