Property cannot be found on forward class object?
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?的更多相关文章
- UITableViewCell Property “icon” cannot be found in forward class object “DJWeiBo”
UITableViewCell 自定义表格 实体属性不显示错误 Property “icon” cannot be found in forward class object “DJWeiBo”引入实 ...
- JavaScript—从数组的indexOf方法深入——Object的Property机制。
在js中,可以说万物皆对象(object),一个数组也是一个对象(array). 很多对象都有很多很方便的方法 比如数组的push,concat,slice等等,但是如果一些对象,它没有实现这些方法, ...
- TypeScript 错误property does not exist on type Object
TypeScript 错误property does not exist on type Object 在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'val ...
- history对象 back() forward() go() 和pushState() replaceState()
History(Window.history对象)对象保存着用户上网的历史记录.处于安全方面的考虑,开发人员无法得知用户浏览过的URL,但是借由用户访问过的页面列表,同样可以在不知道实际URL的情况下 ...
- 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 ...
- python装饰器--@property
@property 考察 Student 类: class Student(object): def __init__(self, name, score): self.name = name sel ...
- property中的strong 、weak、copy 、assign 、retain 、unsafe_unretained 与autoreleasing区别和作用详解
iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存.但是学习还是很有必要的. 在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都 ...
- Controlling z-order using the ZIndex Property
The Composing a XAML Clip Art Scene posting showed how you could layer multiple drawing objects in ...
- Attribute 与 Property 的区别
网上的说法是: Property 是面向对象的概念,是Object的一部分. Attribute 是<input type="text"> type就是Attribut ...
随机推荐
- HDU4539+状态压缩DP
/* 题意:n行m列的矩阵,1表示可以放东西,0表示不可以.曼哈顿距离为2的两个位置最多只能有一个位置放东西. 问最多放多少个东西. */ #include<stdio.h> #inclu ...
- cocos2d-x3.9 默认是 gnustl_static 配置,但是 这个库缺少c++的基础功能... c++_static 功能全面些
最近的升级Cocos2d-x 3.2正式版.iOS不管是什么程序编译问题,使用结果cocos compile -p android编译APK计划.结果悲剧,出现以下错误. Android NDK: I ...
- 修改netbeans模版头部的说明
以新建一个php类文件为例: 有两个地方需要修改, 1,工具->模版->默认许可证->在编辑器中打开 2,工具->模版->选择php类->在编辑器中打开 即可进行修 ...
- js 实现list类
js中没有list类,可以使用Array来实现list类 (function(win) { var ArrayList = function() { this.datas = []; }; var p ...
- Android安全问题 程序锁
导读:本文介绍如何实现对应用加锁的功能,无须root权限 某些人有时候会有这样一种需求,小A下载了个软件,只是软件中的美女过于诱惑与暴露,所以他不想让别人知道这是个什么软件,起码不想让别人打开浏 览. ...
- libevent入门教程
首先给出官方文档吧: http://libevent.org ,首页有个Programming with Libevent,里面是一节一节的介绍libevent,但是感觉信息量太大了,而且还是英文的- ...
- Flash Builder 4.6 找不到所需的Adobe Flash Player
问题: 安装完Flash Builder 4.6 ,第一次运行项目,出现如下错误提示: “Flash Builder 找不到所需版本的 Adobe Flash Player.您可能需要安装该版本的 F ...
- 安装TokuDB引擎
前言:TokuDB 是一个高性能.支持事务处理的 MySQL 和 MariaDB 的存储引擎.TokuDB 的主要特点是高压缩比,高 INSERT 性能,支持大多数在线修改索引.添加字段,非常适合日志 ...
- NPAPI插件开发
1.插件是什么 插件是一种遵循一定规范的应用程序接口编写出来的程序.插件必须依附于一个宿主程序,为宿主程序提供增强功能.插件的种类有很多,这里主要讨论浏览器插件. IE下利用OLE和COM技术开发的浏 ...
- C++中巧妙的位运算
位运算要多想到与预算和异或运算,并常常将两个数对应位上相同和不同分开处理 一.x&(x-1)消除x二进制中最右边的一个1. 这个比较厉害,比如统计某个 二.与和异或的巧妙结合的思想 与运算可以 ...