内存泄露
icharlie2014 opened this issue · comments
我测试TBAlertController时候
出现了内存泄露,检测工具MLeaksFinder
请看86~97行
https://github.com/yulingtianxia/TBActionSheet/blob/master/Example/TBAlertControllerDemo/ViewController.m
下面贴出代码
TBAlertController *controller = [TBAlertController alertControllerWithTitle:@"TBAlertController" message:@"AlertStyle" preferredStyle:TBAlertControllerStyleActionSheet];
TBAlertAction *clickme = [TBAlertAction actionWithTitle:@"点我" style: TBAlertActionStyleDefault handler:^(TBAlertAction * _Nonnull action) {
NSLog(@"%@ ",action.title);
}];
TBAlertAction *cancel = [TBAlertAction actionWithTitle:@"取消" style: TBAlertActionStyleCancel handler:^(TBAlertAction * _Nonnull action) {
NSLog(@"%@ ",action.title);
}];
[controller addAction:clickme];
[controller addAction:cancel];
[self presentViewController:controller animated:YES completion:nil];
@icharlie2014 请问系统版本是什么呢?
@icharlie2014 我用最新版本(1.4.3)测试并没有内存泄露啊,检测工具MLeaksFinder。看你给的代码示例感觉是很旧的版本,新的代码早已加上 self.leakTest
@yulingtianxia 很感谢你的分享,我在 Podfile 中是这样添加的: pod 'TBActionSheet'
不过显示的是 1.4.1 版本,怎么不是最新的 1.4.3 呢?
改成 pod 'TBActionSheet', :git => 'https://github.com/yulingtianxia/TBActionSheet.git' 就ok了。
是吗?
@yulingtianxia 挂梯子 pod setup
都一直没有反应,奇怪~
@tianglin pod setup --verbose
@skyline75489 谢谢,我试一下看行不行。
内存泄露早已解决