首页 技术 正文
技术 2022年11月16日
0 收藏 771 点赞 2,120 浏览 1236 个字

<!–
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px ‘PingFang SC’; color: #239619}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #239619}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #239619; min-height: 16.0px}
span.s1 {font: 14.0px Menlo; font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font: 14.0px ‘PingFang SC’; font-variant-ligatures: no-common-ligatures}
–>

* 在C语言函数中,遇到了create或copy或retain!这些关键单词创建的对象,最后结束的时候,需要自己release!

* ARC -> 自动内存管理针对的是oc!

* 释放对象的方式! CGPathRelease()

<!–
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px ‘PingFang SC’; color: #239619}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font: 14.0px Menlo; font-variant-ligatures: no-common-ligatures}
–>

静态分析工具: -> 从代码的结构上分析是否存在内存管理不当的问题! 快捷键:shift+cmd+b,菜单:product -> analyze,MRC下用的多一些。

 - (void)drawRect:(CGRect)rect {     // 1.获取图形上下文
CGContextRef cxt = UIGraphicsGetCurrentContext(); // 2.给里面添加路径
// 创建路径!
CGMutablePathRef path = CGPathCreateMutable(); // -设置起点!
/**
参数1 路径
参数2 形变 -> NULL
参数3 和 参数4 起点的x,y值!
*/
CGPathMoveToPoint(path, NULL, , ); // -添加线!
CGPathAddLineToPoint(path, NULL, , ); // 给上下文中添加一条路径 CGPathRef类型路径!
CGContextAddPath(cxt, path); // 3.渲染
CGContextStrokePath(cxt); // 4.释放路径资源
CGPathRelease(path);
// 可以释放任何对象! 有时候也不给力!
// CFRelease(path); // kill();
// release(); }
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,960
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,484
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,330
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,113
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,745
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,779