objc_msgSend (xcode)
来源:互联网 发布:福建卓知咨询有限公司 编辑:程序博客网 时间:2024/05/16 01:35
Generally what this means is that you're sending a message (calling a method) on an object that you has been freed. Most likely, you got an object back from an class method, like
and you didn't retain it. If you are using Objective-C 2.0 properties, then you want to specify your properties as retain, and you want to use the mutator (setter) and do not want to assign values to your instance variables directly. So, if it were a string, you'd want to make sure you declared it like:
and then when you use it, make sure to call
or
If it's not something you're storing in an instance variable, then it could be any number of things, hard to say exactly without seeing the code, but basically, look for values returned from class methods that you need to stick around, and then make sure it's either being assigned to a property using the mutator method or dot notation, or make sure you are retaining it.
NSString *myString = [NSString stringWithString:@\"Foo\"];
and you didn't retain it. If you are using Objective-C 2.0 properties, then you want to specify your properties as retain, and you want to use the mutator (setter) and do not want to assign values to your instance variables directly. So, if it were a string, you'd want to make sure you declared it like:
@property (retain) NSString *myString;
and then when you use it, make sure to call
self.myString = (value returned from class method)
or
[self setMyString:(value returned from class method)];
If it's not something you're storing in an instance variable, then it could be any number of things, hard to say exactly without seeing the code, but basically, look for values returned from class methods that you need to stick around, and then make sure it's either being assigned to a property using the mutator method or dot notation, or make sure you are retaining it.
You should be able to figure out which object it is trying to send a message to by running in the debugger, then when it crashes, move up the call trace in the debugger until you get to your code - that should be the line of code where it crashed.
最后发现
if (parent && [parentrespondsToSelector:@selector(changeToPage:name:)] ==YES)
发送消息的parent 已经释放了。- objc_msgSend (xcode)
- xcode反汇编调试iOS模拟器程序(五)调试objc_msgSend函数
- xcode反汇编调试iOS模拟器程序(五)调试objc_msgSend函数
- [Xcode]编译时objc_msgSend错误的解决办法
- objc_msgSend
- runtime简单学习之消息传递objc_msgSend(二)
- objc_msgsend crash
- objc_msgSend函数
- objc_msgSend () 错误
- objc_msgSend函数
- objc_msgSend crash
- runtime objc_msgSend
- 详解objc_msgSend
- runtime-objc_msgSend
- Objc_msgSend 方法
- Xcode中使用method_invoke或者objc_msgSend()报错Too many arguments to function call ,expected 0,have3
- 编写高质量OC代码52建议总结:11.理解objc_msgSend的作用(消息机制)
- objc_msgSend函数 iphone
- android ndk开发环境搭建(windows环境下)
- Backbone.js Wine Cellar 教程 – 第一部分:入门
- mk文件编写,项目配置样例
- ognl深度解析 (对象图导航语言)
- iOS将16进制颜色转成UIColor
- objc_msgSend (xcode)
- Bulk Insert命令详细 .
- Backbone.js Wine Cellar 教程 – 第二部分:CRUD
- 裁剪图片
- 图片缩放
- 图片旋转
- Backbone.js Wine Cellar 教程三:深层链接和应用程序状态
- 论文的题目及摘要,引言
- iOS截屏