项目使用Build And Analyze分析常见提示
来源:互联网 发布:高清半球网络摄像机 编辑:程序博客网 时间:2024/04/29 20:10
1,Incorrect decrement of the reference count of an object that is not owned at this point by the caller
- AttrTable = [[AttrTable node] initAttrTable];
其中node已经创建并初始化了,不需要再调用initAttrTable。如果要调用initAttrTable需改为
- [[[AttrTable alloc] initAttrTable] autorelease]
这种问题一般就是变量申请了内存并初始化了,但没有使用此变量,接着将此变量又重新赋值。如下:
- NSString *imageString = [[NSString alloc] init];
- imageString = @"HResout";
2,Value stored to 'isHD' is never read
变量isHD没有使用
3,Potential leak of an object allocated on line 226 and stored into 'smallclassname'
潜在的内存泄露点
- NSString *smallclassname = [[NSString alloc] initWithString:[NSString stringWithFormat: @"%d",m_NpcClass]];
创建变量的时候尽量使用静态创建,因为静态方法都添加了anturelease,若使用alloc,init时后面最好加上autorelease
4,Pass-by-value argument in function call is undefined
- CGFloat x,y;
- CGFloat w,h;
- w = [backSprite boundingBox].size.width;
- h = [backSprite boundingBox].size.height;
- myRect = CGRectMake(x, y,w ,h );
使用方法CGRectMake时,变量要初始化。代码里的x,y没有赋值。
5,Receiver in message expression is a garbage value
- UIColor* tempCol;
- if (level==4) {
- tempCol= [[UIColor alloc] initWithRed:0.39f green:0.82f blue:0.32f alpha:1.0f];
- }else if (level==5) {
- tempCol= [[UIColor alloc] initWithRed:0.61f green:0.68f blue:0.83f alpha:1.0f];
- }else if (level==6) {
- tempCol= [[UIColor alloc] initWithRed:0.90f green:0.68f blue:0.99f alpha:1.0f];
- }else if (level==7) {
- tempCol= [[UIColor alloc] initWithRed:0.68f green:0.97f blue:0.99f alpha:1.0f];
- }
- return [tempCol autorelease];
被赋值的是个要回收的变量
6,Assigned value is garbage or undefined
- Icon *leftTemp,*centerTemp,*rightTemp;
- if(isHD)
- {
- leftTemp = cell;
- }
- iconLeft = leftTemp;
- iconCenter = centerTemp;
- iconRight = rightTemp;
变量没有初始化就赋值给其他变量时会出现这个提示。即使有条件语句也会有提示。
遇到的就这么多,继续ing。。。
- 项目使用Build And Analyze分析常见提示
- 项目使用Build And Analyze分析常见提示
- 项目运用Build And Analyze分析常见提示
- Build And Analyze 分析常见提示
- 在mrc情况下用Build And Analyze分析常见提示的总结
- 使用Analyze静态分析代码
- iOS开发 Xcode使用Analyze静态分析
- Oracle 使用analyze分析索引碎片
- analyze使用
- Analyze Statement and dbms_stats
- MRR and Analyze tool
- 使用Analyze 和Instruments-Leaks分析解决iOS内存泄露
- analyze 分析表
- ORACLE-ANALYZE命令分析
- Oracle analyze分析
- Analyze静态分析
- Analyze静态分析
- Analyze分析内存
- VC控件ListCtrl的使用方法
- ubuntu下svn工具Rabbitvcs安装
- freemarker 自定义变量
- Java 学习笔记10:获取POST数据以及简单模板输出
- python下的MySQLdb使用
- 项目使用Build And Analyze分析常见提示
- 无线路由开发平台openwrt的编译和使用
- java 获取文件夹大小,文件大小,文件个数
- openGL相关博客
- Ubuntu 12.04安装Google Chrome
- 计算机方向期刊和会议
- vs2010连接 mysql
- JavaScript用匿名闭包封装模块
- iOS 第三方应用调用safari---------杭州卓健信息科技有限公司