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. hdu 3929 Big Coefficients 容斥原理

    看懂题目,很容易想到容斥原理. 刚开始我用的是二进制表示法实现容斥原理,但是一直超时.后来改为dfs就过了…… 代码如下: #include<iostream> #include<s ...

  2. Subset leetcode java

    题目: Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset mus ...

  3. 初始化D3D设备

    bool initD3D(HWND hWnd) { // 主要目的是获取设备,为调用下面的函数做很多准备. // 比如 获取IDirect3D9 ,获取支持的顶点处理,填充后备缓冲相关参数等. // ...

  4. 202. Happy Number

    题目: Write an algorithm to determine if a number is "happy". A happy number is a number def ...

  5. Android 使用SDcard进行文件的读取

    平时我们需要在手机上面存储想音频,视频等等的大文件,以前学过使用File进行存储(使用File操作进行存储):由于考虑到手机本身的存储空间小,这时候我们需要把文件存储在SDcard中,今天自己也学习了 ...

  6. Android invalidate()自动清屏,屏幕刷新

    invalidate()是用来刷新View的,必须是在UI线程中进行工作.比如在修改某个view的显示时,调用invalidate()才能看到重新绘制的界面.invalidate()的调用是把之前的旧 ...

  7. 锋利的JQuery-Jquery选择器

    1.css选择器 标签选择器:a{...} id选择器:#note{...} 类选择器:div.note{..}..dream{...} 群组选择器:td,p,div,a{...} 后代选择器: #l ...

  8. VC 设置 Stack Overflow

    C/C++ stack overflow, 怎样设置stack大小?解决方案 (1) vc6.0: project->setting->link->project options-& ...

  9. Unable to execute dex: Multiple dex files define异常的解决办法

    问题: [2016-01-06 16:47:58 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/sup ...

  10. uva 489 Hangman Judge(水题)

    题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&am ...