关于Cannot assign to 'self' outside of a method in the init family解决方法
有时候我们重写父类的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) initWithXXX;
出错代码:- (id) Myinit{
self = [super init];
……
}
解决方法:- (id) initWithMy
{
self = [super init];
}
转载自http://www.aichengxu.com/view/34741
关于Cannot assign to 'self' outside of a method in the init family解决方法的更多相关文章
- Cannot assign to 'self' outside of a method in the init family
今天在重写父类的init方法时报错如下: error:Cannot assign to 'self' outside of a method in the init family 这种问题以前从来没有 ...
- Xcode工程编译错误:“Cannot assign to 'self' outside of a method in the init family”
#import <Foundation/Foundation.h> @interface EOCRectangle : NSObject<NSCoding> @property ...
- 关于error:Cannot assign to 'self' outside of a method in the init family
有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下:error:Can ...
- 关于vue-cli3打包时遇到Cannot assign to read only property 'exports' of object '#<Object>'问题的解决方法。
vue-cli3打包时遇到Cannot assign to read only property 'exports' of object '#<Object>'问题的解决方法. 大致是说, ...
- 关于error:Cannot assign to 'self' outside of a method in the init family
有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写.在这种方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息例如以下:error:C ...
- php连接memcahed出现Cannot assign requested address (99)的解决方法
今天在将服务器合并后,发现php偶尔会报出 Server *.*.*.* (tcp *****) failed with: Cannot assign requested address (99) 的 ...
- Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法
发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站 小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...
- tomcat java.net.BindException: Cannot assign requested address 解决方法
今天线上TOMCAT启动时遇到了下比较麻烦的问题,错误如下: 21-Apr-2016 15:14:19.077 SEVERE [main] org.apache.catalina.core.Stand ...
- 对于高并发短连接造成Cannot assign requested address解决方法
https://www.cnblogs.com/dadonggg/p/8778318.html 感谢这篇文章给予的启发 在tcp四次挥手断开连接时,主动释放连接的一方最后会进入TIME_WAIT状态, ...
随机推荐
- kafka的推和拉的问题
之前学习过这一问题,但是面试又被问道了.再次记录下 推还是拉? Kafka最初考虑的问题是,customer应该从brokes拉取消息还是brokers将消息推送到consumer,也就是pull还p ...
- iOS应用日志:开始编写日志组件与异常日志
应用日志(一):开始编写日志组件 对于那些做后端开发的工程师来说,看 LOG解Bug应该是理所当然的事,但我接触到的移动应用开发的工程师里面,很多人并没有这个意识,查Bug时总是一遍一遍的试图重现,试 ...
- java中将汉字转换成16进制
技术交流群:233513714 /** * 将汉字转换车16进制字符串 * @param str * @return st */ public static String enUnicode(Stri ...
- [转]GIT PUSH Error 403的解决方法
http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-reques ...
- hotspot
http://openjdk.java.net/groups/hotspot/ Source code Bundles Download Mercurial respository (read-onl ...
- ABBYY FineReader 12最新官方版下载
ABBYY FineReader是市场领先的文字识别(OCR)软件,可快速方便地将扫描纸质文档.PDF文件和数码相机的图像转换成可编辑.可搜索的信息,ABBYY FineReader 12是目前最新版 ...
- Smarty 由 2.X升级到3.X遇到的问题
首先这是一个大概4年前做的PHP项目,使用的是Zend Framework 1 + Smarty 2 , 已经很多年没有动过了, 最近抽风了,把这个项目要玩改版.拿出来改改吧. ZF 升级2这事,还是 ...
- awk命令拷屏
如果不指明采取什么动作,awk默认打印出所有浏览出的记录,与{print $}是一样的 模式和动作两者是可选的,如果没有模式,则action应用到全部记录,如果没有action,则输出匹配全部记录. ...
- ManifoldJS
微软推出开源工具ManifoldJS,可以自动将Web App转换成各种平台的App(安卓.iOS.Chrome OS.Windows). ManifoldJS通过获取网站meta-data信息,即可 ...
- 【转】keypress keydown keyup 区别
KeyPress主要用来接收字母.数字等ANSI字符,而 KeyDown 和 KeyUP 事件过程可以处理任何不被 KeyPress 识别的击键,诸如:功能键(F1-F12).编辑键.定位键以及任何这 ...