关于error:Cannot assign to 'self' outside of a method in the init family
来源:互联网 发布:注册不带www域名 编辑:程序博客网 时间:2024/05/16 18:02
有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下:error:Cannot assign to 'self' outside of a method in the init family
原因:只能在init方法中给self赋值,Xcode判断是否为init方法规则:方法返回id,并且名字以init
出错代码:- (id) Myinit{
}
解决方法:- (id) initWithMy
{
}
0 0
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- [ios]关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to \'self\' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于error:Cannot assign to 'self' outside of a method in the init family
- error:Cannot assign to 'self' outside of a method in the init family
- error:Cannot assign to 'self' outside of a method in the init family
- IE6中盒子绝对定位不起效果的解决方法
- adb push命令的使用
- 2014/8/7
- RTSP
- HDU 4928 Series 2
- 关于error:Cannot assign to 'self' outside of a method in the init family
- <TOMCAT>The APR based Apache Tomcat Native library的解决办法
- 影音租用的好处
- Excel数据导入Mysql数据库
- 通过URL协议实现从Safari等浏览器中跳转打开你的app
- Packet Analyzer: 15 TCPDUMP Command Examples
- java.util.concurrent介绍
- 引进紫黄晶
- Boost相关