Cannot assign to 'self' outside of a method in the init family
来源:互联网 发布:eda软件 编辑:程序博客网 时间:2024/05/16 15:23
有时候我们重写父类的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
- cannot assign to 'self' outside of a method in the init family
- 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
- Cannot assign to 'self' outside of a method in the init family
- Cannot assign to 'self' outside of a method in the init family
- [IOS] 错误: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
- Cannot assign to 'self' outside of a method in the init family
- 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
- 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
- 子类中初始化错误Cannot assign to ’self’ outside of a method in the init family
- 用.net发送 Email 帮助类 EmailHelper
- Mac OS 升级svn客户端
- VB.NET委托一例
- StageFright
- JDK源码阅读之ArrayList
- Cannot assign to 'self' outside of a method in the init family
- msgsnd与msgrcv函数
- tortoise菜单说明
- 【LabVIEW之UI】LabVIEW仿做的Android菜单
- MATLAB与图像处理(四):将图片序列转化为视频文件,将视频文件转化为图片
- git rebase
- 小鸟会飞
- QT C++ 学习资源
- java--获取客户端ip地址